harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6649) String.toLowerCase/toUpperCase incorrect for supplementary characters
Date Thu, 23 Sep 2010 00:10:33 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913861#action_12913861
] 

Robert Muir commented on HARMONY-6649:
--------------------------------------

I thought about this too, 

one concern (not knowing if there are more cases involved) would be if the input "should"
be ascii, but "could" be something else.
if String.toLowerCase had the ascii special-case with a fallback to ICU, it could fail less
gracefully in such a situation if it encountered non-ascii rather than simply not matching,
especially since unit tests tend to have more coverage for the ascii case... 

...but this might be theoretical

> String.toLowerCase/toUpperCase incorrect for supplementary characters
> ---------------------------------------------------------------------
>
>                 Key: HARMONY-6649
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6649
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M15
>            Reporter: Robert Muir
>            Assignee: Tim Ellison
>             Fix For: 5.0M15
>
>         Attachments: HARMONY-6649_filepermission.patch, HARMONY-6649_tests.patch, harmony6649.patch
>
>
> Simple testcase:
> {code}
>     assertEquals("\uD801\uDC44", "\uD801\uDC1C".toLowerCase());
> {code}
> Looking at modules/luni/src/main/java/java/lang/String.java, the problem is these methods
iterate code units (char) not codepoints (int),
> and use Character.toLowerCase(char) and Character.toUpperCase(char), instead of Character.toLowerCase(int),
and Character.toUpperCase(int)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message