harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <rcm...@gmail.com>
Subject Re: [classlib] String.toLowerCase/toUpperCase incorrect for supplementary characters (HARMONY-6649)
Date Thu, 16 Sep 2010 15:04:54 GMT
On Thu, Sep 16, 2010 at 10:50 AM, Tim Ellison <t.p.ellison@gmail.com> wrote:

>
> The principle works ok.  I attached a patch on HARMONY-6649 to show that
> making a local toUpperCase() method for the charset names solves the
> circularity problem in bootstrapping, and does the right thing
> irrespective of locale.
>
> There are some compatibility issues though, since on the RI
>  String foo="foo";
>  foo.toLowerCase() == foo
>
> but it doesn't if we simply use ICU's toLowerCase method :-(
>

maybe we could ask ICU if they could fix this? i looked at their
toLowerCase/toUpperCase methods and it wouldnt require too much hacking:
their UCaseProps returns ~ch whenever ch 'folds to itself', so its easy to
track if its 'unchanged' without doing a second pass/equals().

they might be interested in improved compatibility also.


>
> I also expect we need to fix String#equalsIgnoreCase() to do the right
> thing...
>
>
yes, i noticed this too, we don't have to deal with Locale issues there, but
we have to iterate codepoints / compare with Character.toLowerCase(int) and
Character.toUpperCase(int)...


-- 
Robert Muir
rcmuir@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message