[Choose File] cannot use DBCS filename

VERIFIED FIXED

Status

()

VERIFIED FIXED
18 years ago
18 years ago

People

(Reporter: m_kato, Assigned: m_kato)

Tracking

({intl})

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(3 attachments)

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 }

Comment 2

18 years ago
What functionaries are affected by this (i.e. how to confirm the bug)?

Comment 3

18 years ago
I can reproduce this on 12-12 Mtest build.
Status: UNCONFIRMED → NEW
Ever confirmed: true
QA Contact: teruko → ylong

Comment 4

18 years ago
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

Comment 7

18 years ago
>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.

Comment 9

18 years ago
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).
Created attachment 23038 [details] [diff] [review]
new fix at 2001/01/19

Comment 12

18 years ago
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

Comment 14

18 years ago
sr=alecf on the 2nd patch listed here.
check in
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 16

18 years ago
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.

Comment 17

18 years ago
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 → ---

Updated

18 years ago
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
Last Resolved: 18 years ago18 years ago
Resolution: --- → FIXED

Updated

18 years ago
Status: RESOLVED → VERIFIED

Comment 19

18 years ago
Verified on 05-11 trunk build.
You need to log in before you can comment on or make changes to this bug.