Closed Bug 142870 Opened 23 years ago Closed 23 years ago

nsIFile should use UCS-2 instead of UTF-8

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: darin.moz, Assigned: darin.moz)

Details

Attachments

(1 file)

nsIFile should use UCS-2 instead of UTF-8. UTF-8 seemed nice, but the conversions between UTF-8 and the native charset are costly. moreover, mozilla is generally built-up on UCS-2 strings, and so we should really provide a nsIFile interface that is more useful for the majority of the callers (e.g., javascript needs UCS-2). so that's the gist of this bug... this issue was discussed via email/irc/aim, and we decided that we should make the switch (back) to UCS-2 now before it is too late. the resulting patch is very straightforward.
i've posted an experimental linux build with these changes at http://unagi.mcom.com/~darinf/builds/bug_142870 i've run through some basic tests with a profile located under a non-ASCII path, and everything seems ok.
Status: NEW → ASSIGNED
Attached patch v1 patchSplinter Review
Comment on attachment 82697 [details] [diff] [review] v1 patch got an r=dougt via email
Attachment #82697 - Flags: review+
Comment on attachment 82697 [details] [diff] [review] v1 patch sr=alecf via email
Attachment #82697 - Flags: superreview+
This fix kills my local Sparc Solaris builds, though last night's nightly (2002050722) still seems to work fine. Details of my build environment: Sparc Solaris 7, gcc 2.95.3, and its a debug build that finished early this morning. If I start my build normally Iget 10 lines of : WARNING: wctomb failed: possible charset mismatch, file nsLocalFileUnix.cpp, line 1581 and then the build locks up without opening a window or dumping core. If I run under gdb, a window never opens up, and when I hit control-c to interrupt, I get: 0xff0c9068 in convert_ucs2_to_native (input=@0x1868, result=0xffbeda78 "nxj¸þü¹°", resultLen=1024) at ../../dist/include/string/nsStringIterator.h:182 182 while ( n < 0 ) Should I open a separate bug for this?
jim: yes, please file a separate bug. thx!
Ignore my last comment for now. On further review, I think my build is messed up for other reasons. I'll try building with fresh source, and post a new bug if my problems continue.
Comment 5 is not true. It builds fine for me with fresh source. Sorry about the false alarm.
mass futuring of untargeted bugs
Target Milestone: --- → Future
nsIFile is frozen. This seems to have gotten fixed as it was being frozen. No?
old bug. nsFile is frozen and takes native and ucs2 encoded paths.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: