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
Message from discussion Issue 459 in v8: localeCompare implementation differs from other browsers

Received: by 10.101.176.19 with SMTP id d19mr152380anp.20.1334801731936;
        Wed, 18 Apr 2012 19:15:31 -0700 (PDT)
X-BeenThere: v8-dev@googlegroups.com
Received: by 10.236.140.10 with SMTP id d10ls2537654yhj.4.gmail; Wed, 18 Apr
 2012 19:15:31 -0700 (PDT)
Received: by 10.236.190.162 with SMTP id e22mr353833yhn.6.1334801731250;
        Wed, 18 Apr 2012 19:15:31 -0700 (PDT)
Received: by 10.236.190.162 with SMTP id e22mr353832yhn.6.1334801731242;
        Wed, 18 Apr 2012 19:15:31 -0700 (PDT)
Return-Path: <3Q3WPTxAKBuwQcRSgWhS-bcfSdZmUccUZS.Qcajw-RSjUccUZSUfcidg....@codesite.bounces.google.com>
Received: from mail-gy0-f203.google.com (mail-gy0-f203.google.com [209.85.160.203])
        by gmr-mx.google.com with ESMTPS id y36si737503yhg.2.2012.04.18.19.15.31
        (version=TLSv1/SSLv3 cipher=OTHER);
        Wed, 18 Apr 2012 19:15:31 -0700 (PDT)
Received-SPF: pass (google.com: domain of 3Q3WPTxAKBuwQcRSgWhS-bcfSdZmUccUZS.Qcajw-RSjUccUZSUfcidg....@codesite.bounces.google.com designates 209.85.160.203 as permitted sender) client-ip=209.85.160.203;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of 3Q3WPTxAKBuwQcRSgWhS-bcfSdZmUccUZS.Qcajw-RSjUccUZSUfcidg....@codesite.bounces.google.com designates 209.85.160.203 as permitted sender) smtp.mail=3Q3WPTxAKBuwQcRSgWhS-bcfSdZmUccUZS.Qcajw-RSjUccUZSUfcidg....@codesite.bounces.google.com; dkim=pass header...@google.com
Received: by ghbg20 with SMTP id g20so1112107ghb.0
        for <v8-dev@googlegroups.com>; Wed, 18 Apr 2012 19:15:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=mime-version:reply-to:x-generated-by:x-googlecode-project
         :x-googlecode-issue-id:references:in-reply-to:message-id:date
         :subject:from:to:content-type;
        bh=ogB7nVTaARWzsRhYGTH3rM+i0L0cD5HKHOKqwJLLlro=;
        b=Hh7B9Atb1NOo18dGJktipQWFxnJgwRe568XK6UOH6gkXMLHiVnUS5jIS39qont3Puy
         cWqI05mAq3mSlz28x8Qe4TB1vO2vWXwbm8j+svSZYydqzBMuyIz+9cPXo4XupWresJCN
         JbClJlYWH8z8QVumsWXLy9FkMYP20n0QOurw9oVK/Q4FGgvE6Bcxn/vzExgCpiP4MWi3
         5Nr3EYbvi4/OrViPqrv5QLYVxphpzYCrATXK5OywuuUnolbvZkiz9bQh5ApQ9yqGoMcW
         C61UGkxBO3B71HU6k0K6Yp4vL57Wua6DSlooB36OEBoGXsvtwGUhWZxQSS8VnV+3r/9E
         AVCA==
MIME-Version: 1.0
Received: by 10.224.107.199 with SMTP id c7mr243224qap.8.1334801731123; Wed,
 18 Apr 2012 19:15:31 -0700 (PDT)
Reply-To: codesite-nore...@google.com
X-Generated-By: Google Code
X-GoogleCode-Project: v8
X-GoogleCode-Issue-Id: 459
References: <21-11690816309429728379-10735313661234047218-codesite-noreply=google....@googlecode.com>
 <0-11690816309429728379-10735313661234047218-codesite-noreply=google....@googlecode.com>
In-Reply-To: <21-11690816309429728379-10735313661234047218-codesite-noreply=google....@googlecode.com>
Message-ID: <22-11690816309429728379-10735313661234047218-codesite-noreply=google....@googlecode.com>
Date: Thu, 19 Apr 2012 02:15:31 +0000
Subject: Re: Issue 459 in v8: localeCompare implementation differs from other browsers
From: codesite-nore...@google.com
To: v8-dev@googlegroups.com
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes


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/