-
Bug
-
Resolution: Fixed
-
P3
-
8
-
None
-
b94
-
Verified
FULL PRODUCT VERSION :
java version " 1.8.0-ea "
Java(TM) SE Runtime Environment (build 1.8.0-ea-b82)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows7-64
EXTRA RELEVANT SYSTEM CONFIGURATION :
U+327E may be registered by KS X 1001:2002
http://www.unicode.org/L2/L2004/04267-n2815.pdf
So JDK8 EUC-KR should handle this code.
A DESCRIPTION OF THE PROBLEM :
Conversion table for EUC-KR is incorrect
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. javac EUCKRTest1.java
2. java EUCKRTest1
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
\xA2\xE8 -> \u327E
\u327E -> \xA2\xE8
ACTUAL -
\xA2\xE8 -> \uFFFD
\u327E -> \x3F
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Compile and run following testcase EUCKRTest1.java
===========================================================
import java.nio.charset.*;
public class EUCKRTest1 {
static String encoding = " EUC-KR " ;
public static void c2b(Charset charset, String s) {
for(char c : s.toCharArray()) System.out.printf( " \\u%04X " , (int)c);
System.out.print( " -> " );
for(byte b : s.getBytes(charset)) System.out.printf( " \\x%02X " , (int)b & 0xFF);
System.out.println();
}
public static void b2c(Charset charset, byte[] bs) {
for(byte b : bs) System.out.printf( " \\x%02X " , (int)b & 0xFF);
System.out.print( " -> " );
for(char c : (new String(bs,charset)).toCharArray()) System.out.printf( " \\u%04X " , (int)c);
System.out.println();
}
public static void main(String[] args) throws Exception {
Charset charset = Charset.forName(encoding);
b2c(charset, new byte[]{(byte)0xA2,(byte)0xE8});
c2b(charset, " \u327E " );
}
}
---------- END SOURCE ----------
java version " 1.8.0-ea "
Java(TM) SE Runtime Environment (build 1.8.0-ea-b82)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows7-64
EXTRA RELEVANT SYSTEM CONFIGURATION :
U+327E may be registered by KS X 1001:2002
http://www.unicode.org/L2/L2004/04267-n2815.pdf
So JDK8 EUC-KR should handle this code.
A DESCRIPTION OF THE PROBLEM :
Conversion table for EUC-KR is incorrect
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. javac EUCKRTest1.java
2. java EUCKRTest1
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
\xA2\xE8 -> \u327E
\u327E -> \xA2\xE8
ACTUAL -
\xA2\xE8 -> \uFFFD
\u327E -> \x3F
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Compile and run following testcase EUCKRTest1.java
===========================================================
import java.nio.charset.*;
public class EUCKRTest1 {
static String encoding = " EUC-KR " ;
public static void c2b(Charset charset, String s) {
for(char c : s.toCharArray()) System.out.printf( " \\u%04X " , (int)c);
System.out.print( " -> " );
for(byte b : s.getBytes(charset)) System.out.printf( " \\x%02X " , (int)b & 0xFF);
System.out.println();
}
public static void b2c(Charset charset, byte[] bs) {
for(byte b : bs) System.out.printf( " \\x%02X " , (int)b & 0xFF);
System.out.print( " -> " );
for(char c : (new String(bs,charset)).toCharArray()) System.out.printf( " \\u%04X " , (int)c);
System.out.println();
}
public static void main(String[] args) throws Exception {
Charset charset = Charset.forName(encoding);
b2c(charset, new byte[]{(byte)0xA2,(byte)0xE8});
c2b(charset, " \u327E " );
}
}
---------- END SOURCE ----------