Closed
Bug 60941
Opened 24 years ago
Closed 24 years ago
UNIX filepicker: File Name: field becomes garbage when japanese file is selected
Categories
(Core :: Internationalization, defect, P3)
Tracking
()
VERIFIED
FIXED
People
(Reporter: masaki.katakai, Assigned: jag+mozbugs)
References
Details
(Keywords: intl)
Attachments
(4 files)
(deleted),
image/jpeg
|
Details | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
image/jpeg
|
Details |
On Linux, Solaris platform and in japanese locale,
file name in "File Name:" text field of filepicker
becomes garbage when japanese file is selected.
Please try the following steps to reproduce. I tried
on RH6.2J.
1) make a file with japanese filename
2) Start Mozilla
3) Open file dialog by File -> Open File...
You can see the file can be displayed correctly as japanese
on file list pane
4) select the file
"File name:" text field will be filled by the filename.
However, it becomes garbage.
5) However, the document can be loaded properly by clicking Open
button
I'll attach the snapshot.
Reporter | ||
Comment 1•24 years ago
|
||
Comment 2•24 years ago
|
||
Another problem, when the user correct the gabled file name using IME then the
file cannot be opened.
Reassign to pavlov%netscape.com.
Assignee: nhotta → pavlov
Assignee | ||
Comment 3•24 years ago
|
||
I'll take this for the javascript bits.
We're doing append, initWith etc. instead of their Unicode versions.
Assignee: pavlov → disttsc
Assignee | ||
Comment 4•24 years ago
|
||
Assignee | ||
Comment 5•24 years ago
|
||
Can someone test this?
Reporter | ||
Comment 6•24 years ago
|
||
Hi Peter.
I'm still seeing the problem with you patch. When I selected the japanese filename,
the text field shows garbage. I don't know well about filepicker, but I guess
the following code sets the filename into the textfield. Can you check
file.leafName is correct?
function onSelect(e) {
...
textInput.value = file.leafName;
...
}
Assignee | ||
Comment 7•24 years ago
|
||
Whoops, forgot a whole bunch of unicode* attributes.
New patch coming up.
Assignee | ||
Comment 8•24 years ago
|
||
Assignee | ||
Comment 9•24 years ago
|
||
Masaki: thank you for testing this, I have tried getting japanese input working
but so far haven't succeeded. I believe I now have converted all non-unicode
uses to unicode, the only thing which might go wrong is when nsIFile is
converted to nsIFileURL, and back (when you double click on a directory / file
for example).
Reporter | ||
Comment 10•24 years ago
|
||
Thanks, Peter. Now filepicker with your patch succeeded to display
japanese in file: field.
I've filed a separate bug 60943 for saving file with japanese
filename. Peter and Kato-san, do you think it's the same problem?
Actually, with Peter's patch, japanese filename could be created
properly. However, I'm still seeing the following problems,
- After loading a file with japanese filename, then File->Save As...
japanese filename became garbage (I'll attach the snapshot)
- Deleted the garbage string, then I entered the japanese,
then clicked OK button. The filename of japanese became
garbage on Saving File dialog (that dialog is used for downloaing
file)
Reporter | ||
Comment 11•24 years ago
|
||
Assignee | ||
Comment 12•24 years ago
|
||
Interesting...
After loading a file with a Japanese filename, does the filename display
correctly in the URL bar?
If I recall correctly, urls are 8-bit, which may be part of the problem here...
Reporter | ||
Comment 13•24 years ago
|
||
In URL field, the file name is displayed as %90V%8BK%C3%B7%BD%C4%95%B6%8F%91
format.
I'm seeing the similar problem on WIndows. After I opened a file
with japanese filename, Save As ... would not display the filename on File:
field (just blank) on WIndows FileSelection box (On Linux, it became garbage).
When I opened a file with ascii filename, it would be displayed on File: Field.
So, I'm thinking that filepicker in Linux and FIleDIalog of Windows are correct,
but data at Mozilla -> filepicker is broken. FIleDialog box of Windows rejects
the invalid string, but filepicker shows the garbage. Any comments?
Reporter | ||
Comment 14•24 years ago
|
||
*** Bug 60943 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 15•24 years ago
|
||
The second problem of my comment 2000-12-10 19:36 (garbage on
Save File dialog) seems to be bug 42173. Is the first problem
(garbage on Save As... Dialog) also the same problem?
Kato-san, do you know? Should I file new bug for the first problem?
Anyway, I believe the patch for this problem (also bug 60943)
is ready. Peter, please check-in the patch if you get code review.
Assignee | ||
Comment 16•24 years ago
|
||
> - After loading a file with japanese filename, then File->Save As...
> japanese filename became garbage (I'll attach the snapshot)
That problem still exists, right? Is there a good way an URL can contain
Japanese characters? Because when you save a file, it takes the URL to determine
the filename, and if your URL is incorrect (which it looks like to me, but I
might be wrong) your filename will be incorrect as a result.
Comment 17•24 years ago
|
||
Katakai-san, please wait until 12/15 since my build environment is borken :-<.
I will write fix code...
Comment 18•24 years ago
|
||
Added intl, nsbeta1 keywords
This bug is a potential showstopper for Sun's NS 6 release
Comment 19•24 years ago
|
||
Katakai-san. I found the cause about bug 60943 and screen shot at 12/10. This
problem is that converting from URL to local file path.
If it selects file, onSelect event occur. In onSelect event, it converts from
URL to local path and shows local path.
So for fixing this problem, it must not use URL on directory tree.
Comment 20•24 years ago
|
||
I think that it fixs rdf/datasource/src/nsFileSystemDatasource.cpp, too...
Comment 21•24 years ago
|
||
I tested Peter's patch on RedHat 6.2 + ja-locale. It seems to work fine.
But I found a pretty problem.
@@ -273,19 +273,19 @@
:
:
- // window.alert("Directory "+parent.path+" doesn't seem to exist,
can't save "+file.path);
+ // window.alert("Directory "+parent.path+" doesn't seem to exist,
can't save "+file.unicodePath);
ret = nsIFilePicker.returnCancel;
:
:
please change parent.path -> parent.unicodePath.
looks good except to my comment. Katakai-san, If you use Peter's patch, this
issue isn't fixed, let me know.
Comment 22•24 years ago
|
||
I forgot to answer about Katakai-san's comment.
> - Deleted the garbage string, then I entered the japanese,
> then clicked OK button. The filename of japanese became
> garbage on Saving File dialog (that dialog is used for downloaing
> file)
This is bug 42173, If this is ship stopper of Sun. Let me know.
Comment 23•24 years ago
|
||
add myself to cc list. This bug also happens on HPUX, and will have significant
impact on japanese users. file picker related changed a lot after in trunk. Need
to figure out a way to fix the bug in branch. Probably incorporate all changes in
trunk?
Blocks: 52139
Comment 24•24 years ago
|
||
Peter, it seems to me that a fix is agreed by all parties, at least for
the open file part. Can you check it into trunk? If you need any help,
let me know. Thanks!
Assignee | ||
Comment 25•24 years ago
|
||
Sure, but I'll need an r= and sr= from someone per the checkin rules.
Seeing how you have tested this patch, can I use one of you as the reviewer of
this patch? I'll get the sr= from someone soon.
Assignee | ||
Comment 26•24 years ago
|
||
Comment 27•24 years ago
|
||
I am working on it now. My current build is oem branch, I need a trunk build
to verify this. It should be done pretty soon.
Comment 28•24 years ago
|
||
I applied the patch and tested on linux, it works as expected. I believe
all changes are reasonable and correct.
r = shanjian
Comment 29•24 years ago
|
||
Peter,
It seems that many changes have been made in trunk. Do you see any risk in
adopting those changes in branch? I tried copying nsFilePicker.js,
filepicker.js, filepicker.xul, and it works ok on my local branch tree.
Assignee | ||
Comment 30•24 years ago
|
||
As far as I know, all changes made to the xpfe file picker were restricted to
and contained within those three files you named, so I think it's safe to
synchronize the branch (I assume you're talking about a branch off of the
Mozilla 0.6 branch) to the trunk in this regard, without possibly affecting
anything else.
I will check into the trunk as soon as the tree opens.
Assignee | ||
Comment 31•24 years ago
|
||
Tree opened, fix checked in.
Assignee | ||
Comment 32•24 years ago
|
||
What more needs to be done for this bug?
Comment 33•24 years ago
|
||
I just got approval and checked it into oem branch.
Peter, you can mark the bug as fixed. thanks.
Assignee | ||
Comment 34•24 years ago
|
||
Marking fixed.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 36•24 years ago
|
||
I checked on 01-09-2001 Mtrunk build.
This filepicker issue has been fixed when you try to open a Japanese named file.
However, when you want to change the file name of same page by go to
[File]|[Save as], then you will see the garbage Japanese file name poped
up in "File name" text field of "Save File" dialog. I have another bug 65010
for this issue.
Please let me know if
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•