harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1360) [classlib][nio charset] Charset.forName() returns different value vs Charset.availableCharsets()
Date Thu, 31 Aug 2006 09:42:22 GMT
[classlib][nio charset] Charset.forName() returns different value vs  Charset.availableCharsets()

                 Key: HARMONY-1360
                 URL: http://issues.apache.org/jira/browse/HARMONY-1360
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Vladimir Ivanov

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 + "'");

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


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

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message