Closed Bug 63044 Opened 24 years ago Closed 23 years ago

[Choose File] cannot use DBCS filename

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: m_kato, Assigned: m_kato)

References

()

Details

(Keywords: intl)

Attachments

(3 files)

REPRO STEP
==========
1. [Edit] - [Preferences...]
2. [Navigator] tree on [Category]
3. click [Choose File]
4. select Japanese file and click [OK]

RESULT
======
[Location] text field is incorrect.  This problem 
is /xpfe/components/prefwindow/resources/content/prefutilities.js


http://lxr.mozilla.org/seamonkey/source/xpfe/components/prefwindow/resources/con﷒0﷓

 56 function prefNavSelectFile(folderFieldId, stringId, useNative)
 57 {
 58   var folderField = document.getElementById(folderFieldId);
 59   var dlgString = stringId ? bundle.GetStringFromName(stringId) : '';
 60   var file = getFileOrFolderSpec( dlgString, false );
 61   if( file != -1 )
 62   {
 63     /* XXX nsILocalFile doesn't have a URL string */
 64     if (useNative)
 65     {
 66       folderField.value = file.unicodePath;
 67     }
 68     else
 69     {
 70       // Hack to get a file: url from an nsIFile
 71       var tempFileSpec = Components.classes
["@mozilla.org/filespec;1"].createInstance(Components.interfaces.nsIFileSpec);
 72       tempFileSpec.nativePath = file.unicodePath;
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 73 
 74       try {
 75         var url = tempFileSpec.URLString;
 76         if( url )
 77           folderField.value = url;
 78       }
 79       catch(e) {
 80       }
 81     }
 82   }
 83 }
Attached patch fix codeSplinter Review
What functionaries are affected by this (i.e. how to confirm the bug)?
I can reproduce this on 12-12 Mtest build.
Status: UNCONFIRMED → NEW
Ever confirmed: true
QA Contact: teruko → ylong
r=nhotta

I have a question for the comment.
// file.URL cannot convert DBCS filename.  So we uses nsIFileURL

Is that DBCS specific or generic to non Latin1?
Also, I think "nsIFileSpec.URLString" instead of "file.URL".
So, please change the comment if you agree.

sorry, this is mistake comment :-).  I forgot that its function is not 
implement on other than Windows.  And it will crash when it cancels filepicker.
I attach new fix
Attached patch fix codeSplinter Review
>And it will crash when it cancels filepicker.
I am not clear, crashes with your old patch or even without your any of the patches?
Using old patch, it will crash when you cancel filepicker dialog.
r=nhotta
So you changed getFileOrFolderSpec() to return -1 if the user canceled. Although
not related to your change, the function's return value is not consistent. It
returns "false" or -1 for error and fp.file for success.
Sorry, hotta-san, could you review one more? (old code is not smart like your 
comment).
I think the return value should be unified instead of changing the caller to
check both cases (e.g. file != -1 && file != null).
Sure.
It will be super-view process by old patch.
Thanks, hotta san. 
Status: NEW → ASSIGNED
sr=alecf on the 2nd patch listed here.
check in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
The Japanese file name shows like in [location] text field:
file:///C:/Yuying2/TESTPAGE/%83e%83X%83g.html
I don't know if it is correct or not though, cause Japanese file name display 
like this way around a lots of place in N6.
I re-open the bug cause DBCS file name still not display glyph.  Please change 
the status if it is acceptable.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Keywords: intl
Yuying, your comment is other bug.  Because this bug is what Mozilla cannot 
open DBCS file name.
Please open new bug.
Status: REOPENED → RESOLVED
Closed: 24 years ago23 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
Verified on 05-11 trunk build.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: