Closed Bug 346644 Opened 18 years ago Closed 9 years ago

nsICollation should be at least a bit more cross platform

Categories

(Core :: Internationalization, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 943287

People

(Reporter: timeless, Assigned: smontagu)

References

Details

Attachments

(1 file)

firefox and intl itself expect ()s to be part of the collation behavior. however on unix it isn't.

Steps to reproduce:
1. install firefox-linux/firefox-solaris
2. if you don't have a windows box, install wine, if you don't have wine, trust me.
3. install firefox-win
4. run firefox and select view>character encoding>auto-detect
5. run firefox-win and repeat

if you were running either of them w/ a locale other than en-US, then you're being way too silly, go back and try again using en-US.

expected results:
(Off) sorts before whatever alphabetical items are in the list.

actual results (firefox-unix):
(Off) sorts sorta into the middle (between Korean and Russian).
Blocks: 181515
On linux with glibc 2.4 :

$ cat sorttest
(Off)
English
Chinese
Korean
Russian
Japanese
French

$ LC_ALL=en_US sort sortest  # fr_FR, de_DE, en_US.ISO-8859-1 ....
Chinese
English
French
Japanese
Korean
(Off)
Russian

$ LC_ALL=en_US.UTF-8 sort ~/tmp/sortest 
(Off)
Chinese
English
French
Japanese
Korean
Russian

$ LC_ALL=C sort ~/tmp/sortest 
(Off)
Chinese
English
French
Japanese
Korean
Russian

$ LC_ALL=en_US.CP1252 sort ~/tmp/sortest 
(Off)
Chinese
English
French
Japanese
Korean
Russian


Perhaps you found a 'bug' in en_US, fr_FR, de_DE and other locales that use ISO-8859-1  (of glibc) ....

And, why do we rely on the OS for collation? well ....
QA Contact: amyy → i18n
'O' is larger than 'K' and smaller than 'R', so it's kinda reasonable; "Korean" < "Off" < "Russian", in my opinion. It just skips evaluating '(' for some reason.

According to Unicode Collation Algorithm, "punctuation", such as spaces, double quotes and, probably, open bracket, is defined as Level-4, while "case" is Level-3. i.e. Even case-sensitive sort may ignore '('.
Attached patch UCA v1Splinter Review
> And, why do we rely on the OS for collation? well ....

Is there any chance to replace ::strxfrm(...) and ::strcoll(...) with Mozilla's own implementation? At least it should be replaced with 16bit version of strxfrm(...), and preferably strxfrm_l(...).
After landing bug 1214169, we can replace with ICU's nsICollation except to Android.
I will replace with ICU version by bug 943287.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: