According to the following page,
http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
JDK5.0 supportes
x-Big5_Solaris,x-ISO2022-CN-CNS, ISO2022_CN_CNS, x-ISO2022-CN-GB and ISO2022_CN_GB
However, isSupported() does not check the above encoding correctly.
ex.
The document says "x-Big5_Solaris" is supported, but actually isSupported() checks that "x-Big5-Solaris" is
supported (outputs "true")
(Please look closely the difference between "_" of "x-Big5_Solaris" and "-" of "x-Big5-Solaris")
As to other encodings, Please execute the attached test program.
TEST PROGRAM :
------------------>
import java.nio.charset.*;
class isSupportedTest1 {
public static void main( String arg[] ) {
System.out.println("x-Big5_Solaris" + " is Supported ? : " + Charset.isSupported("x-Big5_Solaris")); /* expected "true" */
System.out.println("x-Big5-Solaris" + " is Supported ? : " + Charset.isSupported("x-Big5-Solaris"));
System.out.println("x-ISO2022-CN-CNS" + " is Supported ? : " + Charset.isSupported("x-ISO2022-CN-CNS")); /* expected "true" */
System.out.println("x-ISO-2022-CN-CNS" + " is Supported ? : " + Charset.isSupported("x-ISO-2022-CN-CNS"));
System.out.println("ISO2022_CN_CNS" + " is Supported ? : " + Charset.isSupported("ISO2022_CN_CNS")); /* expected "true" */
System.out.println("ISO2022CN_CNS" + " is Supported ? : " + Charset.isSupported("ISO2022CN_CNS"));
System.out.println("x-ISO2022-CN-GB" + " is Supported ? : " + Charset.isSupported("x-ISO2022-CN-GB")); /* expected "true" */
System.out.println("x-ISO-2022-CN-GB" + " is Supported ? : " + Charset.isSupported("x-ISO-2022-CN-GB"));
System.out.println("ISO2022_CN_GB" + " is Supported ? : " + Charset.isSupported("ISO2022_CN_GB")); /* expected "true" */
System.out.println("ISO2022CN_GB" + " is Supported ? : " + Charset.isSupported("ISO2022CN_GB"));
}
}
<-----------------
http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
JDK5.0 supportes
x-Big5_Solaris,x-ISO2022-CN-CNS, ISO2022_CN_CNS, x-ISO2022-CN-GB and ISO2022_CN_GB
However, isSupported() does not check the above encoding correctly.
ex.
The document says "x-Big5_Solaris" is supported, but actually isSupported() checks that "x-Big5-Solaris" is
supported (outputs "true")
(Please look closely the difference between "_" of "x-Big5_Solaris" and "-" of "x-Big5-Solaris")
As to other encodings, Please execute the attached test program.
TEST PROGRAM :
------------------>
import java.nio.charset.*;
class isSupportedTest1 {
public static void main( String arg[] ) {
System.out.println("x-Big5_Solaris" + " is Supported ? : " + Charset.isSupported("x-Big5_Solaris")); /* expected "true" */
System.out.println("x-Big5-Solaris" + " is Supported ? : " + Charset.isSupported("x-Big5-Solaris"));
System.out.println("x-ISO2022-CN-CNS" + " is Supported ? : " + Charset.isSupported("x-ISO2022-CN-CNS")); /* expected "true" */
System.out.println("x-ISO-2022-CN-CNS" + " is Supported ? : " + Charset.isSupported("x-ISO-2022-CN-CNS"));
System.out.println("ISO2022_CN_CNS" + " is Supported ? : " + Charset.isSupported("ISO2022_CN_CNS")); /* expected "true" */
System.out.println("ISO2022CN_CNS" + " is Supported ? : " + Charset.isSupported("ISO2022CN_CNS"));
System.out.println("x-ISO2022-CN-GB" + " is Supported ? : " + Charset.isSupported("x-ISO2022-CN-GB")); /* expected "true" */
System.out.println("x-ISO-2022-CN-GB" + " is Supported ? : " + Charset.isSupported("x-ISO-2022-CN-GB"));
System.out.println("ISO2022_CN_GB" + " is Supported ? : " + Charset.isSupported("ISO2022_CN_GB")); /* expected "true" */
System.out.println("ISO2022CN_GB" + " is Supported ? : " + Charset.isSupported("ISO2022CN_GB"));
}
}
<-----------------
- duplicates
-
JDK-6526306 Some encoding names seem incorrect in list of support encoding page of 5.0
-
- Closed
-