Closed
Bug 31246
Opened 25 years ago
Closed 25 years ago
File Open dialog title is corrupted if the tiltle is non-ASCII
Categories
(Core :: Internationalization, defect, P3)
Tracking
()
VERIFIED
WONTFIX
M18
People
(Reporter: rchen, Assigned: law)
References
Details
(Whiteboard: [nsbeta2+])
With browser, go to 'File' menu, then 'Open File' command and look at 'Open
File' on the title bar of the dialog box, Japanese is corrupted.
The data file is navigator.properties with the data:
openFile=\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f
In the dialog itself, do you see the file name correctly?
Is it just in the title of the dialog window where it is displayed wrong?
The title of the dialog is "File Open" which is corrupted if we localize it.
Comment 7•25 years ago
|
||
The problem is in NS_IMETHODIMP nsFileSpecWithUIImpl::ChooseFile(const char
*title, char **_retval)
This interface expect const char* title, but it could receive non ASCII data.
Please change this to PRUnichar* , also
NS_IMETHODIMP nsFileSpecWithUIImpl::ChooseInputFile(
const char *inTitle,
PRUint32 inMask,
const char *inExtraFilterTitle, const char *inExtraFilter)
so we won't lost data.
and in mozilla/widget/public/nsIFileSpecWithUI.idl the interface should use
wstring instead of string for title and OTHER text which may include human
languages.
reassign to law since he show in cvsblame of the idl .
cc jefft since cvsblame show him on the .cpp
The XPConnect automatically drop the higher byte of the unicode when it try to
convert to char* from string, you should change the idl to wstring and the cpp
to PRUnichar* and it should work .
Reassign to who show in the cvsblame.
Assignee: ftang → law
Status: ASSIGNED → NEW
Comment 8•25 years ago
|
||
It seems you also need to change all the places which call it.
ChooseInputFile
Defined as a function in:
widget/src/xpwidgets/nsFileSpecWithUIImpl.cpp, line 237, as member of class
nsFileSpecWithUIImpl
Referenced (in 4 files total) in:
extensions/psm-glue/src/nsPSMUICallbacks.cpp:
View change log or Blame annotations
line 126
netwerk/security/psm/nsPSMUICallbacks.cpp:
View change log or Blame annotations
line 124
widget/src/xpwidgets/nsFileSpecWithUIImpl.cpp:
View change log or Blame annotations
line 145
line 237
mailnews/addrbook/src/nsAddressBook.cpp:
View change log or Blame annotations
line 1260
ChooseFile
Defined as a function in:
widget/src/xpwidgets/nsFileSpecWithUIImpl.cpp, line 143, as member of class
nsFileSpecWithUIImpl
Referenced (in 1 files total) in:
widget/src/xpwidgets/nsFileSpecWithUIImpl.cpp:
View change log or Blame annotations
line 143
Thanks for the excellent instructions in your comments, Frank.
I have a question, still. Regarding the file names accepted/returned by some
nsIFileSpecWithUI methods: Are those acceptable as "char *"? I seem to recall
that all file names can be converted to UTF-8 (but I'm not an expert and that
might not apply on all platforms). I need to know whether to change *all* the
strings to wstrings, or just some/most of them. Thanks again.
Target Milestone: M15
Comment 10•25 years ago
|
||
Whenever you need to convert a file name from PRUnichar to char*, you should
convert it to the "file system charset" . You can find out the file system
charset by calling the nsIPlatformCharset service. You
should get a nsIUnicodeEncoder/nsIUnicodeDecoder to convert between PRUnichar*
and char* in the "file system charset" by passing that file system charset to
nsICharacterConverterManager::GetUnicodeDecoder/Encoder.
Comment 13•25 years ago
|
||
removing nsbeta2-, localizability bugs need to be fixed in beta2. Bob, can you
propose a fix for this bug and help law?
Whiteboard: [nsbeta2-]
Comment 14•25 years ago
|
||
ftang has already provide a lot of pointers.
Bill (law), Do you need more details?
Assignee | ||
Comment 15•25 years ago
|
||
No, I think this is under control, except for getting around to applying the
fix. Priority is on beta2 features so bugs are being put off for a bit longer.
Updated•25 years ago
|
Target Milestone: M16 → M18
Assignee | ||
Comment 17•25 years ago
|
||
Resolving this WONTFIX since nsIFileSpecWithUI is no longer used (at least by
any code I'm aware of). If we find code that uses that interface, a bug should
be opened against that code to have it changed. Somebody might also want to
check that a non-ASCII title actually works with nsIFilePicker (but I think it
does).
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•