Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Issue 459 in v8: localeCompare implementation differs from other browsers
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  19 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
codesite-nore...@google.com  
View profile  
 More options Feb 25 2010, 7:19 pm
From: codesite-nore...@google.com
Date: Fri, 26 Feb 2010 00:19:24 +0000
Local: Thurs, Feb 25 2010 7:19 pm
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #14 on issue 459 by christian.plesner.hansen: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Feb 26 2010, 1:58 pm
From: codesite-nore...@google.com
Date: Fri, 26 Feb 2010 18:58:34 +0000
Local: Fri, Feb 26 2010 1:58 pm
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #15 on issue 459 by js...@chromium.org: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

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).

--
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Aug 25 2010, 1:01 pm
From: codesite-nore...@google.com
Date: Wed, 25 Aug 2010 17:01:02 +0000
Local: Wed, Aug 25 2010 1:01 pm
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #16 on issue 459 by abyssoft: localeCompare implementation differs  
from other browsers
http://code.google.com/p/v8/issues/detail?id=459

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Oct 29 2010, 12:44 am
From: codesite-nore...@google.com
Date: Fri, 29 Oct 2010 04:44:46 +0000
Local: Fri, Oct 29 2010 12:44 am
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #17 on issue 459 by alexdbars: localeCompare implementation differs  
from other browsers
http://code.google.com/p/v8/issues/detail?id=459

same bug here:

     var sH = "Estilo";
     document.write(sH.localeCompare("Brick  ")); 3
     document.write(sH.localeCompare("Yellow  ")) -20
     document.write(sH.localeCompare("Estilo")); 0


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Oct 29 2010, 12:56 am
From: codesite-nore...@google.com
Date: Fri, 29 Oct 2010 04:56:50 +0000
Local: Fri, Oct 29 2010 12:56 am
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #18 on issue 459 by alexdbars: localeCompare implementation differs  
from other browsers
http://code.google.com/p/v8/issues/detail?id=459

same bug here in Google Chrome 5/6/7:

     var sH = "Estilo";
     document.write(sH.localeCompare("Brick  ")); 3
     document.write(sH.localeCompare("Yellow  ")) -20
     document.write(sH.localeCompare("Estilo")); 0


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Jan 25 2011, 7:13 pm
From: codesite-nore...@google.com
Date: Wed, 26 Jan 2011 00:13:00 +0000
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #19 on issue 459 by tor.val...@gmail.com: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

Is it not possible to maybe have something like this?

var b = 'b';
b.localeCompare('ä'); // compare using whatever the user locale is
b.localeCompare('ä', 'de'); // compare using german locale, regardless of  
user locale

and

var num = 123.45;
num.toLocaleString(); // returns '1.234,5' if your locale is norway (comma  
decimal point, period thousand separator)
num.toLocaleString('us'); // returns '1,234.5' regardless of your locale

This would take into account both
1) those who want to actually display to the user what the user is familiar  
with, and
2) those who want to display it in the format of a specific locale.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Jan 25 2011, 7:17 pm
From: codesite-nore...@google.com
Date: Wed, 26 Jan 2011 00:17:07 +0000
Local: Tues, Jan 25 2011 7:17 pm
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #20 on issue 459 by tor.val...@gmail.com: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

Is it not possible to maybe have something like this?

var b = 'b';
b.localeCompare('ä'); // compare using whatever the user locale is
b.localeCompare('ä', 'de'); // compare using german locale, regardless of  
user locale

and

var num = 1234.5;
num.toLocaleString(); // returns '1.234,5' if your locale is norway (comma  
decimal point, period thousand separator)
num.toLocaleString('us'); // returns '1,234.5' regardless of your locale

This would take into account both
1) those who want to actually display to the user what the user is familiar  
with, and
2) those who want to display it in the format of a specific locale.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Feb 23 2012, 7:00 am
From: codesite-nore...@google.com
Date: Thu, 23 Feb 2012 12:00:53 +0000
Local: Thurs, Feb 23 2012 7:00 am
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #21 on issue 459 by vego...@chromium.org: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

Issue 1970 has been merged into this issue.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Apr 18 2012, 10:15 pm
From: codesite-nore...@google.com
Date: Thu, 19 Apr 2012 02:15:31 +0000
Local: Wed, Apr 18 2012 10:15 pm
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #22 on issue 459 by d...@arandomurl.com: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

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

  * http://www.unicode.org/reports/tr10/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Apr 19 2012, 3:33 am
From: codesite-nore...@google.com
Date: Thu, 19 Apr 2012 07:33:29 +0000
Local: Thurs, Apr 19 2012 3:33 am
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers
Updates:
        Labels: Type-FeatureRequest

Comment #23 on issue 459 by yang...@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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options May 2 2012, 8:35 pm
From: codesite-nore...@google.com
Date: Thu, 03 May 2012 00:35:07 +0000
Local: Wed, May 2 2012 8:35 pm
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #24 on issue 459 by paulbenn...@gmail.com: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

"The Spec" (ECMA -  
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262...)  
states:

"The result is intended to order String values in the sort order specified  
by the system default
locale, and will be negative, zero, or positive, depending on whether S  
comes before That in the sort order, the
Strings are equal, or S comes after That in the sort order, respectively."

The result must be -1, 0 or 1, just as other browsers have implemented it.  
Please fix it. This should be a bug not a feature request.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options May 3 2012, 3:11 am
From: codesite-nore...@google.com
Date: Thu, 03 May 2012 07:11:55 +0000
Local: Thurs, May 3 2012 3:11 am
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #25 on issue 459 by svenpa...@chromium.org: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

Reading a few paragraphs further in the spec: "The actual return values are  
implementation-defined to permit implementers to encode additional  
information in the value, but the function is required to define a total  
ordering on all Strings and to return 0 when comparing Strings that are  
considered canonically equivalent by the Unicode standard." So there is  
*no* requirement for -1 and 1, and any JavaScript code depending on this is  
simply wrong.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options May 24 2012, 9:22 am
From: codesite-nore...@google.com
Date: Thu, 24 May 2012 13:22:37 +0000
Local: Thurs, May 24 2012 9:22 am
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #26 on issue 459 by highstr...@gmail.com: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

still hasn't been fixed in chrome 19.... wth, issue started on Oct 6, 2009  
and it hasn't been resolved yet?

HOW IS THIS A FEATURE REQUEST? this is clearly a BUG.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile   Translate to Translated (View Original)
 More options May 30 2012, 5:55 am
From: codesite-nore...@google.com
Date: Wed, 30 May 2012 09:55:28 +0000
Local: Wed, May 30 2012 5:55 am
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #27 on issue 459 by bart.ver...@gmail.com: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

Please point out why this is a bug.

You need to apply to the implementation requirement, not to "how other  
browser's" implement it.

Other browsers implemented this according to the specs. And so did Google.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile   Translate to Translated (View Original)
 More options May 30 2012, 4:29 pm
From: codesite-nore...@google.com
Date: Wed, 30 May 2012 20:29:47 +0000
Local: Wed, May 30 2012 4:29 pm
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #28 on issue 459 by js...@chromium.org: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

Despite what I wrote in comment 15, we did take this to the ECMAScript  
standard group (ECMA TC39) and have made a significant progress.

See http://wiki.ecmascript.org/doku.php?id=strawman:i18n_api for the spec  
and http://code.google.com/p/v8-i18n/ for our implementation (that is a  
part of regular Chrome build).

It does not directly address the behavior of the existing localeCompare()  
with a single input param. Instead, it provides an enhanced API with a  
second parameter for 'locale' name. The same is true of toLocaleString (for  
objects like Date).

The implementation above does not yet implement localeCompare() with a  
locale parameter, yet. It can be implemented in multiple ways. Either  
changing V8 directly (with a dependency on v8-i18n) or v8-i18n can override  
localeCompare() without touching v8 proper.

Moreover, note that ECMAScript i18n module introduces intl.collator ( see  
http://wiki.ecmascript.org/doku.php?id=globalization:specification_dr... )  
that offers more fine-grained support for collation. It's implemented in  
v8-i18n project and usable in chrome canary build.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Oct 3 2012, 7:14 pm
From: codesite-nore...@google.com
Date: Wed, 03 Oct 2012 23:14:17 +0000
Local: Wed, Oct 3 2012 7:14 pm
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #29 on issue 459 by jungs...@google.com: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

This bug is being fixed now. See https://codereview.appspot.com/6591072/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Oct 3 2012, 7:21 pm
From: codesite-nore...@google.com
Date: Wed, 03 Oct 2012 23:21:31 +0000
Local: Wed, Oct 3 2012 7:21 pm
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #30 on issue 459 by jungs...@google.com: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

To be precise, the behavior in v8 won't change with the aforementioned CL.  
However, in Chrome, it'll behave as expected because Chrome has v8-i18n  
that overrides toLocaleXXX with a correct locale-sensitive version.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Mar 28, 1:01 pm
From: codesite-nore...@google.com
Date: Thu, 28 Mar 2013 17:01:15 +0000
Local: Thurs, Mar 28 2013 1:01 pm
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers
Updates:
        Status: WorkingAsIntended

Comment #31 on issue 459 by yang...@chromium.org: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

yes. refer to v8-i18n.

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Mar 28, 2:38 pm
From: codesite-nore...@google.com
Date: Thu, 28 Mar 2013 18:38:55 +0000
Local: Thurs, Mar 28 2013 2:38 pm
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers

Comment #32 on issue 459 by abyss...@gmail.com: localeCompare  
implementation differs from other browsers
http://code.google.com/p/v8/issues/detail?id=459

Confirmed v8-i18n does indeed correct the behavior.

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »