Issue 622 has been merged into this issue.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
One way to deal with issues raised by iposva is to allow JS programmers to
explicitly
specify the locale (BCP 47. which does allows sorting order variations
within a
locale like German phone book vs German dictionary). There's a need for yet
another
parameter for the 'collation strength' (primary, secondary, tertiary and
so forth.
case-sensitivity, whether or not to take into account accents, etc)
However, I'm afraid taking this to ECMA may not work very well (it takes
too long for
one thing if I'm not mistaken). I agree with erik on that.
I wonder if W3C WebAPP WG can be a better venue for this and related issues.
issue 180 is about toLocaleDateString and other date/time format APIs
(chrome bug :
http://crbug.com/3607) not honoring the UI locale of Chrome, but again the
current
API are too limited to be useful.
OpenSocial defines some i18n APIs, but they're limited in other aspects (see
http://wiki.opensocial.org/index.php?title=Gadgets.i18n_(v0.9)). So, I
proposed
exposing some i18n APIs (that Chrome has a full access to) in Javascript
(but not as
a part of the language standard) at
http://crbug.com/28604
BTW, there are two Chrome bug reports on this issue ( http://crbug.com/19254
and http://crbug.com/35600 ) because we're different from all other
browsers (which
do honor the UI locale of a browser).
Additionally the .localeCompare() returns unexpected values in that it
should only return 1, 0 ,-1 currently it is return a comparison of the char
code points.
"a".localeCompare("Z") should return -1 but instead returns 7 which is the
charcode of "a" - charcode of "Z"
Return Value:
0 : It string matches 100%.
-1 : no match, and the parameter value comes before the string object's
value in the locale sort order
1 : no match, and the parameter value comes after the string object's value
in the locale sort order
same bug here:
var sH = "Estilo";
document.write(sH.localeCompare("Brick ")); 3
document.write(sH.localeCompare("Yellow ")) -20
document.write(sH.localeCompare("Estilo")); 0
same bug here in Google Chrome 5/6/7:
Issue 1970 has been merged into this issue.
the fact that locale affects this is only half the problem, the other is
that it isnt currently using any ICU collation, just using the character
values (as mentioned above the raw UTF16 character value), thats why "
> "a".localeCompare("A");
> 32
in chrome, whereas in firefox
> "a".localeCompare('A');
-1
It seems like it would be hard to implement a subset that implemented
collation properly even for just the ascii character range without just
implementing the full unicode collation algorithm *, which would be a
pretty massive job, if anyone has pointers / suggestions I am open to them
though, the app I am building requires ICU collation, even if its only a
single locale that is implemented
Comment #23 on issue 459 by yan...@chromium.org: localeCompare
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459
Marking as feature request as the current implementation does not violate
the spec.