Closed
Bug 199384
Opened 22 years ago
Closed 22 years ago
UTF-8 filename is needed for mach-o fopen/PR_Open
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: nhottanscp, Assigned: ccarlen)
References
Details
Attachments
(1 file)
644 bytes,
patch
|
ccarlen
:
review+
darin.moz
:
superreview+
asa
:
approval1.4a+
|
Details | Diff | Splinter Review |
This is separated from local mail folder bug 172472.
For mach-o, fopen and PR_Open requires filename as UTF-8. Because this is mach-o
specific the XP callers pass filename as platform charset.
I heard that nsLocalFile for Mac also takes UTF-8 filename now. We can change
the platform charset to be UTF-8 for MacOS X. In order to do that, nsIFileSpec
need to change to take care UTF-8 filename.
Reporter | ||
Comment 1•22 years ago
|
||
nsbeta1
I think this is also "embed" but I do not have an actual example.
Basically, wherever using fopen/PR_Open cannot open non-Ascii filenames in
mach-o build. A known problem is that non-Ascii local mail folder cannot be
created (bug 172472).
Keywords: nsbeta1
Summary: UTF-8 filename is needed for mach-o fopen/PR_Open → UTF-8 filename is needed for mach-o fopen/PR_Open
Reporter | ||
Comment 2•22 years ago
|
||
I spend time debugging and found opening a file for nsIFileSpec is done by
PR_Open for mach-o.
Note that the code below is in #else part of #ifdef XP_MAC but XP_MAC is not
defined for mach-o (very confusing).
http://lxr.mozilla.org/seamonkey/source/xpcom/obsolete/nsIFileStream.cpp#284
284 // Platforms other than Macintosh...
285 // Another bug in NSPR: Mac PR_Open assumes a unix style path, but Win
PR_Open assumes
286 // a windows path.
287 if ((mFileDesc = PR_Open((const char*)nsFileSpec(inFile), nsprMode,
accessMode)) == 0)
288 return NS_FILE_RESULT(PR_GetError());
Anyway, at least open file for nsIFileSpec works with UTF-8 filename
(need to confirm this with ccarlen),
I think we can change the platform charset for mach-o to UTF-8.
Reporter | ||
Comment 3•22 years ago
|
||
Reporter | ||
Updated•22 years ago
|
Attachment #118709 -
Flags: review?(ccarlen)
Assignee | ||
Comment 4•22 years ago
|
||
Comment on attachment 118709 [details] [diff] [review]
Return UTF-8 as a platform file charset.
r=ccarlen. The FS charset on Mach-O is either UTF-8 or UCS-2, depending on
which APIs are used.
Which code is creating nsFileSpecs with paths mapped by uconv? I think this is
only a problem in that case. If using nsILocalFile, this shouldn't be a
problem.
Attachment #118709 -
Flags: review?(ccarlen) → review+
Reporter | ||
Comment 5•22 years ago
|
||
>Which code is creating nsFileSpecs with paths mapped by uconv?
Some mail code like import use nsFileSpec, also several other places in mail/news.
And mozilla/db/mork does not use xpcom/io but calls fopen directly.
Reporter | ||
Updated•22 years ago
|
Attachment #118709 -
Flags: superreview?(darin)
Reporter | ||
Comment 6•22 years ago
|
||
reassign to nhotta
Comment 7•22 years ago
|
||
Comment on attachment 118709 [details] [diff] [review]
Return UTF-8 as a platform file charset.
sr=darin
Attachment #118709 -
Flags: superreview?(darin) → superreview+
Reporter | ||
Updated•22 years ago
|
Attachment #118709 -
Flags: approval1.4a?
Comment 8•22 years ago
|
||
Comment on attachment 118709 [details] [diff] [review]
Return UTF-8 as a platform file charset.
a=asa (on behalf of drivers) for checkin to 1.4a but this needs to land fast if
it's gonna make it.
Attachment #118709 -
Flags: approval1.4a? → approval1.4a+
Reporter | ||
Comment 9•22 years ago
|
||
checked in to the trunk
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 10•22 years ago
|
||
Does this fix bug 194618, also?
Comment 11•22 years ago
|
||
*** Bug 200008 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•