You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tony Wu (JIRA)" <ji...@apache.org> on 2007/02/06 11:27:05 UTC
[jira] Commented: (HARMONY-1360) [classlib][nio charset]
Charset.forName() returns different value vs Charset.availableCharsets()
[ https://issues.apache.org/jira/browse/HARMONY-1360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470509 ]
Tony Wu commented on HARMONY-1360:
----------------------------------
This is a bug of ICU, I have reported it to ICU bug db,
http://bugs.icu-project.org/trac/ticket/5580
> [classlib][nio charset] Charset.forName() returns different value vs Charset.availableCharsets()
> -------------------------------------------------------------------------------------------------
>
> Key: HARMONY-1360
> URL: https://issues.apache.org/jira/browse/HARMONY-1360
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Vladimir Ivanov
> Attachments: CharsetTest.patch
>
>
> The spec says for the method Charset.availableCharsets(): "In the absence of such changes (dynamically load of new charset providers), the charsets returned by this method are exactly those that can be retrieved via the forName method.
> It works on RI but fails on Harmony.
> ================= test.java =======================
> import java.util.SortedMap;
> import java.nio.charset.Charset;
> public class test {
> public static void main(String args[]) {
> SortedMap allCharsets = Charset.availableCharsets();
> Object[] names = allCharsets.keySet().toArray();
> for (int i = 0; i < names.length; ++i){
> Charset _chset = (Charset) allCharsets.get(names[i]);
> Charset chset = Charset.forName((String) names[i]);
> if (!chset.name().equals(_chset.name())){
> System.out.println("forName(" + names[i] + ") returned '" +
> chset + "', instead of '" + _chset + "'");
> }
> }
> System.out.println("END");
> }
> }
> ===============================================
> Output:
> C:\tmp\tmp17>C:\jrockit-jdk1.5.0-windows-ia32\bin\java.exe -cp . -showversion test
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
> END
> C:\tmp\tmp17>C:\harmony\classlib1.5\deploy\jdk\jre\bin\java.exe -cp . -showversion test
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> forName(KSC_5601) returned 'Charset[EUC-KR]', instead of 'Charset[KSC_5601]'
> END
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.