-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.0
-
x86
-
windows_2000
7 82359734 - unmatch code: Uni=>GB18030:
9FF8 82359735 - unmatch code: Uni=>GB18030:
9FF9 82359736 - unmatch code: Uni=>GB18030:
9FFA 82359737 - unmatch code: Uni=>GB18030:
9FFB 82359738 - unmatch code: Uni=>GB18030:
9FFC 82359739 - unmatch code: Uni=>GB18030:
9FFD 82359830 - unmatch code: Uni=>GB18030:
9FFE 82359831 - unmatch code: Uni=>GB18030:
9FFF 82359832 - unmatch code: Uni=>GB18030:
A000 82359833 - unmatch code: Uni=>GB18030:
D7A4 8336BE37 - unmatch code: Uni=>GB18030:
D7A5 8336BE38 - unmatch code: Uni=>GB18030:
D7A6 8336BE39 - unmatch code: Uni=>GB18030:
D7A7 8336BF30 - unmatch code: Uni=>GB18030:
D7A8 8336BF31 - unmatch code: Uni=>GB18030:
D7A9 8336BF32 - unmatch code: Uni=>GB18030:
D7AA 8336BF33 - unmatch code: Uni=>GB18030:
D7AB 8336BF34 - unmatch code: Uni=>GB18030:
D7AC 8336BF35 - unmatch code: Uni=>GB18030:
D7AD 8336BF36 - unmatch code: Uni=>GB18030:
D7AE 8336BF37 - unmatch code: Uni=>GB18030:
D7AF 8336BF38 - unmatch code: Uni=>GB18030:
D7B0 8336BF39 - unmatch code: Uni=>GB18030:
D7B1 8336C030 - unmatch code: Uni=>GB18030:
D7B2 8336C031 - unmatch code: Uni=>GB18030:
D7B3 8336C032 - unmatch code: Uni=>GB18030:
D7B4 8336C033 - unmatch code: Uni=>GB18030:
D7B5 8336C034 - unmatch code: Uni=>GB18030:
D7B6 8336C035 - unmatch code: Uni=>GB18030:
D7B7 8336C036 - unmatch code: Uni=>GB18030:
D7B8 8336C037 - unmatch code: Uni=>GB18030:
D7B9 8336C038 - unmatch code: Uni=>GB18030:
D7BA 8336C039 - unmatch code: Uni=>GB18030:
D7BB 8336C130 - unmatch code: Uni=>GB18030:
D7BC 8336C131 - unmatch code: Uni=>GB18030:
D7BD 8336C132 - unmatch code: Uni=>GB18030:
D7BE 8336C133 - unmatch code: Uni=>GB18030:
D7BF 8336C134 - unmatch code: Uni=>GB18030:
D7C0 8336C135 - unmatch code: Uni=>GB18030:
D7C1 8336C136 - unmatch code: Uni=>GB18030:
D7C2 8336C137 - unmatch code: Uni=>GB18030:
D7C3 8336C138 - unmatch code: Uni=>GB18030:
D7C4 8336C139 - unmatch code: Uni=>GB18030:
D7C5 8336C230 - unmatch code: Uni=>GB18030:
D7C6 8336C231 - unmatch code: Uni=>GB18030:
D7C7 8336C232 - unmatch code: Uni=>GB18030:
D7C8 8336C233 - unmatch code: Uni=>GB18030:
D7C9 8336C234 - unmatch code: Uni=>GB18030:
D7CA 8336C235 - unmatch code: Uni=>GB18030:
D7CB 8336C236 - unmatch code: Uni=>GB18030:
D7CC 8336C237 - unmatch code: Uni=>GB18030:
D7CD 8336C238 - unmatch code: Uni=>GB18030:
D7CE 8336C239 - unmatch code: Uni=>GB18030:
D7CF 8336C330 - unmatch code: Uni=>GB18030:
D7D0 8336C331 - unmatch code: Uni=>GB18030:
D7D1 8336C332 - unmatch code: Uni=>GB18030:
D7D2 8336C333 - unmatch code: Uni=>GB18030:
D7D3 8336C334 - unmatch code: Uni=>GB18030:
D7D4 8336C335 - unmatch code: Uni=>GB18030:
D7D5 8336C336 - unmatch code: Uni=>GB18030:
D7D6 8336C337 - unmatch code: Uni=>GB18030:
D7D7 8336C338 - unmatch code: Uni=>GB18030:
D7D8 8336C339 - unmatch code: Uni=>GB18030:
D7D9 8336C430 - unmatch code: Uni=>GB18030:
D7DA 8336C431 - unmatch code: Uni=>GB18030:
D7DB 8336C432 - unmatch code: Uni=>GB18030:
D7DC 8336C433 - unmatch code: Uni=>GB18030:
D7DD 8336C434 - unmatch code: Uni=>GB18030:
D7DE 8336C435 - unmatch code: Uni=>GB18030:
D7DF 8336C436 - unmatch code: Uni=>GB18030:
D7E0 8336C437 - unmatch code: Uni=>GB18030:
D7E1 8336C438 - unmatch code: Uni=>GB18030:
D7E2 8336C439 - unmatch code: Uni=>GB18030:
D7E3 8336C530 - unmatch code: Uni=>GB18030:
D7E4 8336C531 - unmatch code: Uni=>GB18030:
D7E5 8336C532 - unmatch code: Uni=>GB18030:
D7E6 8336C533 - unmatch code: Uni=>GB18030:
D7E7 8336C534 - unmatch code: Uni=>GB18030:
D7E8 8336C535 - unmatch code: Uni=>GB18030:
D7E9 8336C536 - unmatch code: Uni=>GB18030:
D7EA 8336C537 - unmatch code: Uni=>GB18030:
D7EB 8336C538 - unmatch code: Uni=>GB18030:
D7EC 8336C539 - unmatch code: Uni=>GB18030:
D7ED 8336C630 - unmatch code: Uni=>GB18030:
D7EE 8336C631 - unmatch code: Uni=>GB18030:
D7EF 8336C632 - unmatch code: Uni=>GB18030:
D7F0 8336C633 - unmatch code: Uni=>GB18030:
D7F1 8336C634 - unmatch code: Uni=>GB18030:
D7F2 8336C635 - unmatch code: Uni=>GB18030:
D7F3 8336C636 - unmatch code: Uni=>GB18030:
D7F4 8336C637 - unmatch code: Uni=>GB18030:
D7F5 8336C638 - unmatch code: Uni=>GB18030:
D7F6 8336C639 - unmatch code: Uni=>GB18030:
D7F7 8336C730 - unmatch code: Uni=>GB18030:
D7F8 8336C731 - unmatch code: Uni=>GB18030:
D7F9 8336C732 - unmatch code: Uni=>GB18030:
D7FA 8336C733 - unmatch code: Uni=>GB18030:
D7FB 8336C734 - unmatch code: Uni=>GB18030:
D7FC 8336C735 - unmatch code: Uni=>GB18030:
D7FD 8336C736 - unmatch code: Uni=>GB18030:
D7FE 8336C737 - unmatch code: Uni=>GB18030:
D7FF 8336C738 - unmatch code: Uni=>GB18030:
FA2E 84309D32 - unmatch code: GB18030=>Uni: fffd
FAA6 8430A932 - unmatch code: GB18030=>Uni: fffd
FAA7 8430A933 - unmatch code: GB18030=>Uni: fffd
(omitted)
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.*;
public class CheckCode
{
String inFileName = "test.in";
String line_buffer;
byte[] bytes_buf;
byte[] bytesGB;
char[] charUtf= new char[1];
String cov_string;
byte[] cov_bytes;
int checkLines = 0;
int okLines = 0;
int ngLines = 0;
public CheckCode() {
}
public String toHexString( int i ) { return Integer.toHexString( i ); }
void println( String out_text ) { System.out.println( out_text ); }
void print( String out_text ) { System.out.print( out_text ); }
int intFrom1Hex( char lo )
{
if ((lo < 0x30)) {
} else if (lo <= 0x39) {
return (byte)(lo - 0x30);
} else if (lo < 0x41) {
} else if (lo <= 0x46) {
return (byte)(lo - 0x41 + 10);
} else if (lo < 0x61) {
} else if (lo <= 0x66) {
return (byte)(lo - 0x61 + 10);
} else {
}
return 0;
}
int intFromHexString( String hex_str )
{
int ret = 0;
for (int i = 0; i < hex_str.length(); ++i) {
ret = ret * 0x10 + intFrom1Hex(hex_str.charAt(i));
}
// System.out.println( "intFromHexString: " + ret );
return ret;
}
byte[] bytesFromString( String buf )
{
byte[] retBuf = new byte[ buf.length() / 2];
for (int i = 0; i < retBuf.length; i++)
{
retBuf[i] = (byte)Integer.parseInt( buf.substring(i*2,i*2+2), 16 );
}
return retBuf;
}
void parseLine()
{
int iS1 = 0, iS2 = 0, iS3 = 0;
char tmp_c;
for (int i = 0; i < line_buffer.length(); ++i)
{
tmp_c = line_buffer.charAt(i);
if ((tmp_c == 0x20) ||
(tmp_c == 0x09)) {
if (iS1 == 0)
{
iS1 = i;
iS2 = i;
}
else if (iS2 + 1 == i)
{
iS2 = i;
}
else if (iS3 == 0)
{
iS3 = i;
}
}
} /* End for*/
iS2++;
if (iS3 == 0) iS3 = line_buffer.length();
charUtf[0] = (char)intFromHexString( line_buffer.substring(0,iS1) );
bytesGB = bytesFromString( line_buffer.substring(iS2,iS3) );
}
boolean checkUniToGb()
{
cov_string = new String( charUtf );
try
{
cov_bytes = cov_string.getBytes( "GB18030" );
}
catch (java.io.UnsupportedEncodingException e)
{
e.printStackTrace(System.err);
return false;
}
if (cov_bytes.length != bytesGB.length)
{
error_log( "unmatch length(" + cov_bytes.length + ":" +
bytesGB.length + "): Uni=>GB18030" );
return false;
}
else
{
int iCheck;
for (iCheck = 0; iCheck < cov_bytes.length; ++iCheck)
{
// println( iCheck + toHexString(bytesGB[iCheck]) +
// ":" + toHexString(cov_bytes[iCheck]) );
if (bytesGB[iCheck] != cov_bytes[iCheck]) break;
}
if (iCheck != cov_bytes.length)
{
error_log( "unmatch code: Uni=>GB18030: " );
print( " " + iCheck + "*" + cov_bytes.length + ":" );
for (int i = 0; i < cov_bytes.length; ++i)
{
print( " " + toHexString( cov_bytes[i] ));
}
println( "<<" );
return false;
}
else
{
// System.out.println( "ok: Uni=>GB18030" );
}
}
return true;
}
boolean checkGbToUni()
{
try
{
cov_string = new String( bytesGB, "GB18030" );
}
catch (java.io.UnsupportedEncodingException e)
{
e.printStackTrace(System.err);
return false;
}
if (cov_string.length() < 1)
{
error_log( "invalid length(" + cov_string.length() +
"): GB18030=>Uni" );
return false;
}
if (cov_string.charAt(0) != charUtf[0])
{
error_log( "unmatch code: GB18030=>Uni: " +
toHexString(cov_string.charAt(0)) );
return false;
}
else
{
// System.out.println( "ok: GB18030=>Uni" );
}
return true;
}
void run() {
BufferedReader in;
try
{
in = new BufferedReader(new FileReader(inFileName));
} /* End try*/
catch (IOException e)
{
line_buffer = null;
e.printStackTrace(System.err);
return;
} /* End catch*/
do
{
try
{
line_buffer = in.readLine();
} /* End
try*/
catch (IOException e)
{
line_buffer = null;
e.printStackTrace(System.err);
} /* End
catch*/
if (line_buffer == null) break;
if (line_buffer == "") break;
checkLines++;
System.out.println( ">>" + line_buffer + "<<" );
parseLine();
boolean rc1 = checkUniToGb();
boolean rc2 = checkGbToUni();
if (rc1 && rc2) okLines++;
} while (line_buffer != null); /* End do*/
try
{
in.close();
} /* End try*/
catch (IOException e)
{
line_buffer = null;
e.printStackTrace(System.err);
} /* End catch*/
}
void error_log( String msg) {
PrintWriter out;
System.out.println( msg );
try
{
out = new PrintWriter(new BufferedWriter(new FileWriter(
"error.log", true )));
out.println( line_buffer + " - " + msg );
out.close();
}
catch (IOException e)
{
e.printStackTrace(System.err);
}
}
void report() {
System.out.println( "checked lines: " + checkLines );
System.out.println( "ok lines: " + okLines );
}
public static void main(String[] args) {
System.out.println( "ReadLine starting..." );
CheckCode pgm = new CheckCode();
if (args.length >= 1)
{
pgm.inFileName = args[0];
}
pgm.run();
pgm.report();
}
}
---------- END SOURCE ----------
(Review ID: 143891)
======================================================================
Name: nt126004 Date: 03/15/2002
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
Service Pack 2
ADDITIONAL OPERATING SYSTEMS :
EXTRA RELEVANT SYSTEM CONFIGURATION :
GB18030 Support Package installed
A DESCRIPTION OF THE PROBLEM :
Some of Unicode characters are converted incorrectly from
Unicode to GB18030 via String getBytes().
Some of GB18030 characters are converted incorrectly from
GB18030 to Unicode via String class construction.
(See "actual results" or you can find error.log by running
CheckCode.java)
All characters should be converted correctly and should be
matched with the table provided by China government.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.Prepare/Make right table of Unicode to GB18030. Or, you
can create a file (has a part of full table) from "Expected
results"---see "Top of Table" to "End of Table".
2.Run the test program "CheckCode" with the table filename
(ex. java CheckCode table.txt)
3.
EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected result: All characters should be converted
correctly and should be matched with the table provided by
China government.
Unicode GB18030
------- --------
===== Top of TABLE =====
03A2 8130CB31
2596 81379936
2597 81379937
2598 81379938
2599 81379939
259A 81379A30
259B 81379A31
259C 81379A32
259D 81379A33
259E 81379A34
259F 81379A35
2FFC 8139A332
2FFD 8139A333
2FFE 8139A334
2FFF 8139A335
309F 8139A733
30A0 8139A734
30FF 8139A830
3100 8139A831
3101 8139A832
3102 8139A833
3103 8139A834
3104 8139A835
9FA6 82358F33
9FA7 82358F34
9FA8 82358F35
9FA9 82358F36
9FAA 82358F37
9FAB 82358F38
9FAC 82358F39
9FAD 82359030
9FAE 82359031
9FAF 82359032
9FB0 82359033
9FB1 82359034
9FB2 82359035
9FB3 82359036
9FB4 82359037
9FB5 82359038
9FB6 82359039
9FB7 82359130
9FB8 82359131
9FB9 82359132
9FBA 82359133
9FBB 82359134
9FBC 82359135
9FBD 82359136
9FBE 82359137
9FBF 82359138
9FC0 82359139
9FC1 82359230
9FC2 82359231
9FC3 82359232
9FC4 82359233
9FC5 82359234
9FC6 82359235
9FC7 82359236
9FC8 82359237
9FC9 82359238
9FCA 82359239
9FCB 82359330
9FCC 82359331
9FCD 82359332
9FCE 82359333
9FCF 82359334
9FD0 82359335
9FD1 82359336
9FD2 82359337
9FD3 82359338
9FD4 82359339
9FD5 82359430
9FD6 82359431
9FD7 82359432
9FD8 82359433
9FD9 82359434
9FDA 82359435
9FDB 82359436
9FDC 82359437
9FDD 82359438
9FDE 82359439
9FDF 82359530
9FE0 82359531
9FE1 82359532
9FE2 82359533
9FE3 82359534
9FE4 82359535
9FE5 82359536
9FE6 82359537
9FE7 82359538
9FE8 82359539
9FE9 82359630
9FEA 82359631
9FEB 82359632
9FEC 82359633
9FED 82359634
9FEE 82359635
9FEF 82359636
9FF0 82359637
9FF1 82359638
9FF2 82359639
9FF3 82359730
9FF4 82359731
9FF5 82359732
9FF6 82359733
9FF7 82359734
9FF8 82359735
9FF9 82359736
9FFA 82359737
9FFB 82359738
9FFC 82359739
9FFD 82359830
9FFE 82359831
9FFF 82359832
A000 82359833
D7A4 8336BE37
D7A5 8336BE38
D7A6 8336BE39
D7A7 8336BF30
D7A8 8336BF31
D7A9 8336BF32
D7AA 8336BF33
D7AB 8336BF34
D7AC 8336BF35
D7AD 8336BF36
D7AE 8336BF37
D7AF 8336BF38
D7B0 8336BF39
D7B1 8336C030
D7B2 8336C031
D7B3 8336C032
D7B4 8336C033
D7B5 8336C034
D7B6 8336C035
D7B7 8336C036
D7B8 8336C037
D7B9 8336C038
D7BA 8336C039
D7BB 8336C130
D7BC 8336C131
D7BD 8336C132
D7BE 8336C133
D7BF 8336C134
D7C0 8336C135
D7C1 8336C136
D7C2 8336C137
D7C3 8336C138
D7C4 8336C139
D7C5 8336C230
D7C6 8336C231
D7C7 8336C232
D7C8 8336C233
D7C9 8336C234
D7CA 8336C235
D7CB 8336C236
D7CC 8336C237
D7CD 8336C238
D7CE 8336C239
D7CF 8336C330
D7D0 8336C331
D7D1 8336C332
D7D2 8336C333
D7D3 8336C334
D7D4 8336C335
D7D5 8336C336
D7D6 8336C337
D7D7 8336C338
D7D8 8336C339
D7D9 8336C430
D7DA 8336C431
D7DB 8336C432
D7DC 8336C433
D7DD 8336C434
D7DE 8336C435
D7DF 8336C436
D7E0 8336C437
D7E1 8336C438
D7E2 8336C439
D7E3 8336C530
D7E4 8336C531
D7E5 8336C532
D7E6 8336C533
D7E7 8336C534
D7E8 8336C535
D7E9 8336C536
D7EA 8336C537
D7EB 8336C538
D7EC 8336C539
D7ED 8336C630
D7EE 8336C631
D7EF 8336C632
D7F0 8336C633
D7F1 8336C634
D7F2 8336C635
D7F3 8336C636
D7F4 8336C637
D7F5 8336C638
D7F6 8336C639
D7F7 8336C730
D7F8 8336C731
D7F9 8336C732
D7FA 8336C733
D7FB 8336C734
D7FC 8336C735
D7FD 8336C736
D7FE 8336C737
D7FF 8336C738
FA2E 84309D32
FA2F 84309D33
FA30 84309D34
FA31 84309D35
FA32 84309D36
FA33 84309D37
FA34 84309D38
FA35 84309D39
FA36 84309E30
FA37 84309E31
FA38 84309E32
FA39 84309E33
FA3A 84309E34
FA3B 84309E35
FA3C 84309E36
FA3D 84309E37
FA3E 84309E38
FA3F 84309E39
FA40 84309F30
FA41 84309F31
FA42 84309F32
FA43 84309F33
FA44 84309F34
FA45 84309F35
FA46 84309F36
FA47 84309F37
FA48 84309F38
FA49 84309F39
FA4A 8430A030
FA4B 8430A031
FA4C 8430A032
FA4D 8430A033
FA4E 8430A034
FA4F 8430A035
FA50 8430A036
FA51 8430A037
FA52 8430A038
FA53 8430A039
FA54 8430A130
FA55 8430A131
FA56 8430A132
FA57 8430A133
FA58 8430A134
FA59 8430A135
FA5A 8430A136
FA5B 8430A137
FA5C 8430A138
FA5D 8430A139
FA5E 8430A230
FA5F 8430A231
FA60 8430A232
FA61 8430A233
FA62 8430A234
FA63 8430A235
FA64 8430A236
FA65 8430A237
FA66 8430A238
FA67 8430A239
FA68 8430A330
FA69 8430A331
FA6A 8430A332
FA6B 8430A333
FA6C 8430A334
FA6D 8430A335
FA6E 8430A336
FA6F 8430A337
FA70 8430A338
FA71 8430A339
FA72 8430A430
FA73 8430A431
FA74 8430A432
FA75 8430A433
FA76 8430A434
FA77 8430A435
FA78 8430A436
FA79 8430A437
FA7A 8430A438
FA7B 8430A439
FA7C 8430A530
FA7D 8430A531
FA7E 8430A532
FA7F 8430A533
FA80 8430A534
FA81 8430A535
FA82 8430A536
FA83 8430A537
FA84 8430A538
FA85 8430A539
FA86 8430A630
FA87 8430A631
FA88 8430A632
FA89 8430A633
FA8A 8430A634
FA8B 8430A635
FA8C 8430A636
FA8D 8430A637
FA8E 8430A638
FA8F 8430A639
FA90 8430A730
FA91 8430A731
FA92 8430A732
FA93 8430A733
FA94 8430A734
FA95 8430A735
FA96 8430A736
FA97 8430A737
FA98 8430A738
FA99 8430A739
FA9A 8430A830
FA9B 8430A831
FA9C 8430A832
FA9D 8430A833
FA9E 8430A834
FA9F 8430A835
FAA0 8430A836
FAA1 8430A837
FAA2 8430A838
FAA3 8430A839
FAA4 8430A930
FAA5 8430A931
FAA6 8430A932
FAA7 8430A933
FAA8 8430A934
FAA9 8430A935
FAAA 8430A936
FAAB 8430A937
FAAC 8430A938
FAAD 8430A939
FAAE 8430AA30
FAAF 8430AA31
FAB0 8430AA32
FAB1 8430AA33
FAB2 8430AA34
FAB3 8430AA35
FAB4 8430AA36
FAB5 8430AA37
FAB6 8430AA38
FAB7 8430AA39
FAB8 8430AB30
FAB9 8430AB31
FABA 8430AB32
FABB 8430AB33
FABC 8430AB34
FABD 8430AB35
FABE 8430AB36
FABF 8430AB37
FAC0 8430AB38
FAC1 8430AB39
FAC2 8430AC30
FAC3 8430AC31
FAC4 8430AC32
FAC5 8430AC33
FAC6 8430AC34
FAC7 8430AC35
FAC8 8430AC36
FAC9 8430AC37
FACA 8430AC38
FACB 8430AC39
FACC 8430AD30
FACD 8430AD31
FACE 8430AD32
FACF 8430AD33
FAD0 8430AD34
FAD1 8430AD35
FAD2 8430AD36
FAD3 8430AD37
FAD4 8430AD38
FAD5 8430AD39
FAD6 8430AE30
FAD7 8430AE31
FAD8 8430AE32
FAD9 8430AE33
FADA 8430AE34
FADB 8430AE35
FADC 8430AE36
FADD 8430AE37
FADE 8430AE38
FADF 8430AE39
FAE0 8430AF30
FAE1 8430AF31
FAE2 8430AF32
FAE3 8430AF33
FAE4 8430AF34
FAE5 8430AF35
FAE6 8430AF36
FAE7 8430AF37
FAE8 8430AF38
FAE9 8430AF39
FAEA 8430B030
FAEB 8430B031
FAEC 8430B032
FAED 8430B033
FAEE 8430B034
FAEF 8430B035
FAF0 8430B036
FAF1 8430B037
FAF2 8430B038
FAF3 8430B039
FAF4 8430B130
FAF5 8430B131
FAF6 8430B132
FAF7 8430B133
FAF8 8430B134
FAF9 8430B135
FAFA 8430B136
FAFB 8430B137
FAFC 8430B138
FAFD 8430B139
FAFE 8430B230
FAFF 8430B231
FB07 8430B239
FB08 8430B330
FB09 8430B331
FB0A 8430B332
FB0B 8430B333
FB0C 8430B334
FB0D 8430B335
FB0E 8430B336
FB0F 8430B337
FB10 8430B338
FB11 8430B339
FB12 8430B430
FB18 8430B436
FB19 8430B437
FB1A 8430B438
FB1B 8430B439
FB1C 8430B530
FB37 8430B737
FB3D 8430B833
FB3F 8430B835
FB42 8430B838
FB45 8430B931
FBB2 8430C430
FBB3 8430C431
FBB4 8430C432
FBB5 8430C433
FBB6 8430C434
FBB7 8430C435
FBB8 8430C436
FBB9 8430C437
FBBA 8430C438
FBBB 8430C439
FBBC 8430C530
FBBD 8430C531
FBBE 8430C532
FBBF 8430C533
FBC0 8430C534
FBC1 8430C535
FBC2 8430C536
FBC3 8430C537
FBC4 8430C538
FBC5 8430C539
FBC6 8430C630
FBC7 8430C631
FBC8 8430C632
FBC9 8430C633
FBCA 8430C634
FBCB 8430C635
FBCC 8430C636
FBCD 8430C637
FBCE 8430C638
FBCF 8430C639
FBD0 8430C730
FBD1 8430C731
FBD2 8430C732
FD40 8430EB38
FD41 8430EB39
FD42 8430EC30
FD43 8430EC31
FD44 8430EC32
FD45 8430EC33
FD46 8430EC34
FD47 8430EC35
FD48 8430EC36
FD49 8430EC37
FD4A 8430EC38
FD4B 8430EC39
FD4C 8430ED30
FD4D 8430ED31
FD4E 8430ED32
FD4F 8430ED33
FD90 8430F338
FD91 8430F339
FDC8 8430F934
FDC9 8430F935
FDCA 8430F936
FDCB 8430F937
FDCC 8430F938
FDCD 8430F939
FDCE 8430FA30
FDCF 8430FA31
FDD0 8430FA32
FDD1 8430FA33
FDD2 8430FA34
FDD3 8430FA35
FDD4 8430FA36
FDD5 8430FA37
FDD6 8430FA38
FDD7 8430FA39
FDD8 8430FB30
FDD9 8430FB31
FDDA 8430FB32
FDDB 8430FB33
FDDC 8430FB34
FDDD 8430FB35
FDDE 8430FB36
FDDF 8430FB37
FDE0 8430FB38
FDE1 8430FB39
FDE2 8430FC30
FDE3 8430FC31
FDE4 8430FC32
FDE5 8430FC33
FDE6 8430FC34
FDE7 8430FC35
FDE8 8430FC36
FDE9 8430FC37
FDEA 8430FC38
FDEB 8430FC39
FDEC 8430FD30
FDED 8430FD31
FDEE 8430FD32
FDEF 8430FD33
FDFC 8430FE36
FDFD 8430FE37
FDFE 8430FE38
FDFF 8430FE39
FE00 84318130
FE01 84318131
FE02 84318132
FE03 84318133
FE04 84318134
FE05 84318135
FE06 84318136
FE07 84318137
FE08 84318138
FE09 84318139
FE0A 84318230
FE0B 84318231
FE0C 84318232
FE0D 84318233
FE0E 84318234
FE0F 84318235
FE10 84318236
FE11 84318237
FE12 84318238
FE13 84318239
FE14 84318330
FE15 84318331
FE16 84318332
FE17 84318333
FE18 84318334
FE19 84318335
FE1A 84318336
FE1B 84318337
FE1C 84318338
FE1D 84318339
FE1E 84318430
FE1F 84318431
FE24 84318436
FE25 84318437
FE26 84318438
FE27 84318439
FE28 84318530
FE29 84318531
FE2A 84318532
FE2B 84318533
FE2C 84318534
FE2D 84318535
FE2E 84318536
FE2F 84318537
FE45 84318539
FE46 84318630
FE47 84318631
FE48 84318632
FE53 84318633
FE67 84318635
FE6C 84318636
FE6D 84318637
FE6E 84318638
FE6F 84318639
FE73 84318733
FE75 84318735
FEFD 84319531
FEFE 84319532
FF00 84319534
FF5F 84319535
FF60 84319536
FFBF 84319F31
FFC0 84319F32
FFC1 84319F33
FFC8 8431A030
FFC9 8431A031
FFD0 8431A038
FFD1 8431A039
FFD8 8431A136
FFD9 8431A137
FFDD 8431A231
FFDE 8431A232
FFDF 8431A233
FFE0 A1E9
FFE7 8431A235
FFEF 8431A333
FFF0 8431A334
FFF1 8431A335
FFF2 8431A336
FFF3 8431A337
FFF4 8431A338
FFF5 8431A339
FFF6 8431A430
FFF7 8431A431
FFF8 8431A432
FFFE 8431A438
FFFF 8431A439
===== End of TABLE =====
Actual results:
03A2 8130CB31 - unmatch code: GB18030=>Uni: 391
2596 81379936 - unmatch code: GB18030=>Uni: 2593
2597 81379937 - unmatch code: GB18030=>Uni: 2594
2598 81379938 - unmatch code: GB18030=>Uni: 2595
2599 81379939 - unmatch code: GB18030=>Uni: 2596
259A 81379A30 - unmatch code: GB18030=>Uni: 2597
259B 81379A31 - unmatch code: GB18030=>Uni: 2598
259C 81379A32 - unmatch code: GB18030=>Uni: 2599
259D 81379A33 - unmatch code: GB18030=>Uni: 259a
259E 81379A34 - unmatch code: GB18030=>Uni: 259b
259F 81379A35 - unmatch code: GB18030=>Uni: 259c
2FFC 8139A332 - unmatch code: Uni=>GB18030:
2FFC 8139A332 - unmatch code: GB18030=>Uni: 2ff0
2FFD 8139A333 - unmatch code: Uni=>GB18030:
2FFD 8139A333 - unmatch code: GB18030=>Uni: 2ff1
2FFE 8139A334 - unmatch code: Uni=>GB18030:
2FFE 8139A334 - unmatch code: GB18030=>Uni: 2ff2
2FFF 8139A335 - unmatch code: Uni=>GB18030:
2FFF 8139A335 - unmatch code: GB18030=>Uni: 2ff3
309F 8139A733 - unmatch code: GB18030=>Uni: 309b
30A0 8139A734 - unmatch code: GB18030=>Uni: 309c
30FF 8139A830 - unmatch code: GB18030=>Uni: 30fc
3100 8139A831 - unmatch code: GB18030=>Uni: 30fd
3101 8139A832 - unmatch code: GB18030=>Uni: 30fe
3102 8139A833 - unmatch code: GB18030=>Uni: 30ff
3103 8139A834 - unmatch code: GB18030=>Uni: 3100
3104 8139A835 - unmatch code: GB18030=>Uni: 3101
9FA6 82358F33 - unmatch code: Uni=>GB18030:
9FA7 82358F34 - unmatch code: Uni=>GB18030:
9FA8 82358F35 - unmatch code: Uni=>GB18030:
9FA9 82358F36 - unmatch code: Uni=>GB18030:
9FAA 82358F37 - unmatch code: Uni=>GB18030:
9FAB 82358F38 - unmatch code: Uni=>GB18030:
9FAC 82358F39 - unmatch code: Uni=>GB18030:
9FAD 82359030 - unmatch code: Uni=>GB18030:
9FAE 82359031 - unmatch code: Uni=>GB18030:
9FAF 82359032 - unmatch code: Uni=>GB18030:
9FB0 82359033 - unmatch code: Uni=>GB18030:
9FB1 82359034 - unmatch code: Uni=>GB18030:
9FB2 82359035 - unmatch code: Uni=>GB18030:
9FB3 82359036 - unmatch code: Uni=>GB18030:
9FB4 82359037 - unmatch code: Uni=>GB18030:
9FB5 82359038 - unmatch code: Uni=>GB18030:
9FB6 82359039 - unmatch code: Uni=>GB18030:
9FB7 82359130 - unmatch code: Uni=>GB18030:
9FB8 82359131 - unmatch code: Uni=>GB18030:
9FB9 82359132 - unmatch code: Uni=>GB18030:
9FBA 82359133 - unmatch code: Uni=>GB18030:
9FBB 82359134 - unmatch code: Uni=>GB18030:
9FBC 82359135 - unmatch code: Uni=>GB18030:
9FBD 82359136 - unmatch code: Uni=>GB18030:
9FBE 82359137 - unmatch code: Uni=>GB18030:
9FBF 82359138 - unmatch code: Uni=>GB18030:
9FC0 82359139 - unmatch code: Uni=>GB18030:
9FC1 82359230 - unmatch code: Uni=>GB18030:
9FC2 82359231 - unmatch code: Uni=>GB18030:
9FC3 82359232 - unmatch code: Uni=>GB18030:
9FC4 82359233 - unmatch code: Uni=>GB18030:
9FC5 82359234 - unmatch code: Uni=>GB18030:
9FC6 82359235 - unmatch code: Uni=>GB18030:
9FC7 82359236 - unmatch code: Uni=>GB18030:
9FC8 82359237 - unmatch code: Uni=>GB18030:
9FC9 82359238 - unmatch code: Uni=>GB18030:
9FCA 82359239 - unmatch code: Uni=>GB18030:
9FCB 82359330 - unmatch code: Uni=>GB18030:
9FCC 82359331 - unmatch code: Uni=>GB18030:
9FCD 82359332 - unmatch code: Uni=>GB18030:
9FCE 82359333 - unmatch code: Uni=>GB18030:
9FCF 82359334 - unmatch code: Uni=>GB18030:
9FD0 82359335 - unmatch code: Uni=>GB18030:
9FD1 82359336 - unmatch code: Uni=>GB18030:
9FD2 82359337 - unmatch code: Uni=>GB18030:
9FD3 82359338 - unmatch code: Uni=>GB18030:
9FD4 82359339 - unmatch code: Uni=>GB18030:
9FD5 82359430 - unmatch code: Uni=>GB18030:
9FD6 82359431 - unmatch code: Uni=>GB18030:
9FD7 82359432 - unmatch code: Uni=>GB18030:
9FD8 82359433 - unmatch code: Uni=>GB18030:
9FD9 82359434 - unmatch code: Uni=>GB18030:
9FDA 82359435 - unmatch code: Uni=>GB18030:
9FDB 82359436 - unmatch code: Uni=>GB18030:
9FDC 82359437 - unmatch code: Uni=>GB18030:
9FDD 82359438 - unmatch code: Uni=>GB18030:
9FDE 82359439 - unmatch code: Uni=>GB18030:
9FDF 82359530 - unmatch code: Uni=>GB18030:
9FE0 82359531 - unmatch code: Uni=>GB18030:
9FE1 82359532 - unmatch code: Uni=>GB18030:
9FE2 82359533 - unmatch code: Uni=>GB18030:
9FE3 82359534 - unmatch code: Uni=>GB18030:
9FE4 82359535 - unmatch code: Uni=>GB18030:
9FE5 82359536 - unmatch code: Uni=>GB18030:
9FE6 82359537 - unmatch code: Uni=>GB18030:
9FE7 82359538 - unmatch code: Uni=>GB18030:
9FE8 82359539 - unmatch code: Uni=>GB18030:
9FE9 82359630 - unmatch code: Uni=>GB18030:
9FEA 82359631 - unmatch code: Uni=>GB18030:
9FEB 82359632 - unmatch code: Uni=>GB18030:
9FEC 82359633 - unmatch code: Uni=>GB18030:
9FED 82359634 - unmatch code: Uni=>GB18030:
9FEE 82359635 - unmatch code: Uni=>GB18030:
9FEF 82359636 - unmatch code: Uni=>GB18030:
9FF0 82359637 - unmatch code: Uni=>GB18030:
9FF1 82359638 - unmatch code: Uni=>GB18030:
9FF2 82359639 - unmatch code: Uni=>GB18030:
9FF3 82359730 - unmatch code: Uni=>GB18030:
9FF4 82359731 - unmatch code: Uni=>GB18030:
9FF5 82359732 - unmatch code: Uni=>GB18030:
9FF6 82359733 - unmatch code: Uni=>GB18030:
9FF
9FF8 82359735 - unmatch code: Uni=>GB18030:
9FF9 82359736 - unmatch code: Uni=>GB18030:
9FFA 82359737 - unmatch code: Uni=>GB18030:
9FFB 82359738 - unmatch code: Uni=>GB18030:
9FFC 82359739 - unmatch code: Uni=>GB18030:
9FFD 82359830 - unmatch code: Uni=>GB18030:
9FFE 82359831 - unmatch code: Uni=>GB18030:
9FFF 82359832 - unmatch code: Uni=>GB18030:
A000 82359833 - unmatch code: Uni=>GB18030:
D7A4 8336BE37 - unmatch code: Uni=>GB18030:
D7A5 8336BE38 - unmatch code: Uni=>GB18030:
D7A6 8336BE39 - unmatch code: Uni=>GB18030:
D7A7 8336BF30 - unmatch code: Uni=>GB18030:
D7A8 8336BF31 - unmatch code: Uni=>GB18030:
D7A9 8336BF32 - unmatch code: Uni=>GB18030:
D7AA 8336BF33 - unmatch code: Uni=>GB18030:
D7AB 8336BF34 - unmatch code: Uni=>GB18030:
D7AC 8336BF35 - unmatch code: Uni=>GB18030:
D7AD 8336BF36 - unmatch code: Uni=>GB18030:
D7AE 8336BF37 - unmatch code: Uni=>GB18030:
D7AF 8336BF38 - unmatch code: Uni=>GB18030:
D7B0 8336BF39 - unmatch code: Uni=>GB18030:
D7B1 8336C030 - unmatch code: Uni=>GB18030:
D7B2 8336C031 - unmatch code: Uni=>GB18030:
D7B3 8336C032 - unmatch code: Uni=>GB18030:
D7B4 8336C033 - unmatch code: Uni=>GB18030:
D7B5 8336C034 - unmatch code: Uni=>GB18030:
D7B6 8336C035 - unmatch code: Uni=>GB18030:
D7B7 8336C036 - unmatch code: Uni=>GB18030:
D7B8 8336C037 - unmatch code: Uni=>GB18030:
D7B9 8336C038 - unmatch code: Uni=>GB18030:
D7BA 8336C039 - unmatch code: Uni=>GB18030:
D7BB 8336C130 - unmatch code: Uni=>GB18030:
D7BC 8336C131 - unmatch code: Uni=>GB18030:
D7BD 8336C132 - unmatch code: Uni=>GB18030:
D7BE 8336C133 - unmatch code: Uni=>GB18030:
D7BF 8336C134 - unmatch code: Uni=>GB18030:
D7C0 8336C135 - unmatch code: Uni=>GB18030:
D7C1 8336C136 - unmatch code: Uni=>GB18030:
D7C2 8336C137 - unmatch code: Uni=>GB18030:
D7C3 8336C138 - unmatch code: Uni=>GB18030:
D7C4 8336C139 - unmatch code: Uni=>GB18030:
D7C5 8336C230 - unmatch code: Uni=>GB18030:
D7C6 8336C231 - unmatch code: Uni=>GB18030:
D7C7 8336C232 - unmatch code: Uni=>GB18030:
D7C8 8336C233 - unmatch code: Uni=>GB18030:
D7C9 8336C234 - unmatch code: Uni=>GB18030:
D7CA 8336C235 - unmatch code: Uni=>GB18030:
D7CB 8336C236 - unmatch code: Uni=>GB18030:
D7CC 8336C237 - unmatch code: Uni=>GB18030:
D7CD 8336C238 - unmatch code: Uni=>GB18030:
D7CE 8336C239 - unmatch code: Uni=>GB18030:
D7CF 8336C330 - unmatch code: Uni=>GB18030:
D7D0 8336C331 - unmatch code: Uni=>GB18030:
D7D1 8336C332 - unmatch code: Uni=>GB18030:
D7D2 8336C333 - unmatch code: Uni=>GB18030:
D7D3 8336C334 - unmatch code: Uni=>GB18030:
D7D4 8336C335 - unmatch code: Uni=>GB18030:
D7D5 8336C336 - unmatch code: Uni=>GB18030:
D7D6 8336C337 - unmatch code: Uni=>GB18030:
D7D7 8336C338 - unmatch code: Uni=>GB18030:
D7D8 8336C339 - unmatch code: Uni=>GB18030:
D7D9 8336C430 - unmatch code: Uni=>GB18030:
D7DA 8336C431 - unmatch code: Uni=>GB18030:
D7DB 8336C432 - unmatch code: Uni=>GB18030:
D7DC 8336C433 - unmatch code: Uni=>GB18030:
D7DD 8336C434 - unmatch code: Uni=>GB18030:
D7DE 8336C435 - unmatch code: Uni=>GB18030:
D7DF 8336C436 - unmatch code: Uni=>GB18030:
D7E0 8336C437 - unmatch code: Uni=>GB18030:
D7E1 8336C438 - unmatch code: Uni=>GB18030:
D7E2 8336C439 - unmatch code: Uni=>GB18030:
D7E3 8336C530 - unmatch code: Uni=>GB18030:
D7E4 8336C531 - unmatch code: Uni=>GB18030:
D7E5 8336C532 - unmatch code: Uni=>GB18030:
D7E6 8336C533 - unmatch code: Uni=>GB18030:
D7E7 8336C534 - unmatch code: Uni=>GB18030:
D7E8 8336C535 - unmatch code: Uni=>GB18030:
D7E9 8336C536 - unmatch code: Uni=>GB18030:
D7EA 8336C537 - unmatch code: Uni=>GB18030:
D7EB 8336C538 - unmatch code: Uni=>GB18030:
D7EC 8336C539 - unmatch code: Uni=>GB18030:
D7ED 8336C630 - unmatch code: Uni=>GB18030:
D7EE 8336C631 - unmatch code: Uni=>GB18030:
D7EF 8336C632 - unmatch code: Uni=>GB18030:
D7F0 8336C633 - unmatch code: Uni=>GB18030:
D7F1 8336C634 - unmatch code: Uni=>GB18030:
D7F2 8336C635 - unmatch code: Uni=>GB18030:
D7F3 8336C636 - unmatch code: Uni=>GB18030:
D7F4 8336C637 - unmatch code: Uni=>GB18030:
D7F5 8336C638 - unmatch code: Uni=>GB18030:
D7F6 8336C639 - unmatch code: Uni=>GB18030:
D7F7 8336C730 - unmatch code: Uni=>GB18030:
D7F8 8336C731 - unmatch code: Uni=>GB18030:
D7F9 8336C732 - unmatch code: Uni=>GB18030:
D7FA 8336C733 - unmatch code: Uni=>GB18030:
D7FB 8336C734 - unmatch code: Uni=>GB18030:
D7FC 8336C735 - unmatch code: Uni=>GB18030:
D7FD 8336C736 - unmatch code: Uni=>GB18030:
D7FE 8336C737 - unmatch code: Uni=>GB18030:
D7FF 8336C738 - unmatch code: Uni=>GB18030:
FA2E 84309D32 - unmatch code: GB18030=>Uni: fffd
FAA6 8430A932 - unmatch code: GB18030=>Uni: fffd
FAA7 8430A933 - unmatch code: GB18030=>Uni: fffd
(omitted)
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.*;
public class CheckCode
{
String inFileName = "test.in";
String line_buffer;
byte[] bytes_buf;
byte[] bytesGB;
char[] charUtf= new char[1];
String cov_string;
byte[] cov_bytes;
int checkLines = 0;
int okLines = 0;
int ngLines = 0;
public CheckCode() {
}
public String toHexString( int i ) { return Integer.toHexString( i ); }
void println( String out_text ) { System.out.println( out_text ); }
void print( String out_text ) { System.out.print( out_text ); }
int intFrom1Hex( char lo )
{
if ((lo < 0x30)) {
} else if (lo <= 0x39) {
return (byte)(lo - 0x30);
} else if (lo < 0x41) {
} else if (lo <= 0x46) {
return (byte)(lo - 0x41 + 10);
} else if (lo < 0x61) {
} else if (lo <= 0x66) {
return (byte)(lo - 0x61 + 10);
} else {
}
return 0;
}
int intFromHexString( String hex_str )
{
int ret = 0;
for (int i = 0; i < hex_str.length(); ++i) {
ret = ret * 0x10 + intFrom1Hex(hex_str.charAt(i));
}
// System.out.println( "intFromHexString: " + ret );
return ret;
}
byte[] bytesFromString( String buf )
{
byte[] retBuf = new byte[ buf.length() / 2];
for (int i = 0; i < retBuf.length; i++)
{
retBuf[i] = (byte)Integer.parseInt( buf.substring(i*2,i*2+2), 16 );
}
return retBuf;
}
void parseLine()
{
int iS1 = 0, iS2 = 0, iS3 = 0;
char tmp_c;
for (int i = 0; i < line_buffer.length(); ++i)
{
tmp_c = line_buffer.charAt(i);
if ((tmp_c == 0x20) ||
(tmp_c == 0x09)) {
if (iS1 == 0)
{
iS1 = i;
iS2 = i;
}
else if (iS2 + 1 == i)
{
iS2 = i;
}
else if (iS3 == 0)
{
iS3 = i;
}
}
} /* End for*/
iS2++;
if (iS3 == 0) iS3 = line_buffer.length();
charUtf[0] = (char)intFromHexString( line_buffer.substring(0,iS1) );
bytesGB = bytesFromString( line_buffer.substring(iS2,iS3) );
}
boolean checkUniToGb()
{
cov_string = new String( charUtf );
try
{
cov_bytes = cov_string.getBytes( "GB18030" );
}
catch (java.io.UnsupportedEncodingException e)
{
e.printStackTrace(System.err);
return false;
}
if (cov_bytes.length != bytesGB.length)
{
error_log( "unmatch length(" + cov_bytes.length + ":" +
bytesGB.length + "): Uni=>GB18030" );
return false;
}
else
{
int iCheck;
for (iCheck = 0; iCheck < cov_bytes.length; ++iCheck)
{
// println( iCheck + toHexString(bytesGB[iCheck]) +
// ":" + toHexString(cov_bytes[iCheck]) );
if (bytesGB[iCheck] != cov_bytes[iCheck]) break;
}
if (iCheck != cov_bytes.length)
{
error_log( "unmatch code: Uni=>GB18030: " );
print( " " + iCheck + "*" + cov_bytes.length + ":" );
for (int i = 0; i < cov_bytes.length; ++i)
{
print( " " + toHexString( cov_bytes[i] ));
}
println( "<<" );
return false;
}
else
{
// System.out.println( "ok: Uni=>GB18030" );
}
}
return true;
}
boolean checkGbToUni()
{
try
{
cov_string = new String( bytesGB, "GB18030" );
}
catch (java.io.UnsupportedEncodingException e)
{
e.printStackTrace(System.err);
return false;
}
if (cov_string.length() < 1)
{
error_log( "invalid length(" + cov_string.length() +
"): GB18030=>Uni" );
return false;
}
if (cov_string.charAt(0) != charUtf[0])
{
error_log( "unmatch code: GB18030=>Uni: " +
toHexString(cov_string.charAt(0)) );
return false;
}
else
{
// System.out.println( "ok: GB18030=>Uni" );
}
return true;
}
void run() {
BufferedReader in;
try
{
in = new BufferedReader(new FileReader(inFileName));
} /* End try*/
catch (IOException e)
{
line_buffer = null;
e.printStackTrace(System.err);
return;
} /* End catch*/
do
{
try
{
line_buffer = in.readLine();
} /* End
try*/
catch (IOException e)
{
line_buffer = null;
e.printStackTrace(System.err);
} /* End
catch*/
if (line_buffer == null) break;
if (line_buffer == "") break;
checkLines++;
System.out.println( ">>" + line_buffer + "<<" );
parseLine();
boolean rc1 = checkUniToGb();
boolean rc2 = checkGbToUni();
if (rc1 && rc2) okLines++;
} while (line_buffer != null); /* End do*/
try
{
in.close();
} /* End try*/
catch (IOException e)
{
line_buffer = null;
e.printStackTrace(System.err);
} /* End catch*/
}
void error_log( String msg) {
PrintWriter out;
System.out.println( msg );
try
{
out = new PrintWriter(new BufferedWriter(new FileWriter(
"error.log", true )));
out.println( line_buffer + " - " + msg );
out.close();
}
catch (IOException e)
{
e.printStackTrace(System.err);
}
}
void report() {
System.out.println( "checked lines: " + checkLines );
System.out.println( "ok lines: " + okLines );
}
public static void main(String[] args) {
System.out.println( "ReadLine starting..." );
CheckCode pgm = new CheckCode();
if (args.length >= 1)
{
pgm.inFileName = args[0];
}
pgm.run();
pgm.report();
}
}
---------- END SOURCE ----------
(Review ID: 143891)
======================================================================
Name: nt126004 Date: 03/15/2002
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
Service Pack 2
ADDITIONAL OPERATING SYSTEMS :
EXTRA RELEVANT SYSTEM CONFIGURATION :
GB18030 Support Package installed
A DESCRIPTION OF THE PROBLEM :
Some of Unicode characters are converted incorrectly from
Unicode to GB18030 via String getBytes().
Some of GB18030 characters are converted incorrectly from
GB18030 to Unicode via String class construction.
(See "actual results" or you can find error.log by running
CheckCode.java)
All characters should be converted correctly and should be
matched with the table provided by China government.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.Prepare/Make right table of Unicode to GB18030. Or, you
can create a file (has a part of full table) from "Expected
results"---see "Top of Table" to "End of Table".
2.Run the test program "CheckCode" with the table filename
(ex. java CheckCode table.txt)
3.
EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected result: All characters should be converted
correctly and should be matched with the table provided by
China government.
Unicode GB18030
------- --------
===== Top of TABLE =====
03A2 8130CB31
2596 81379936
2597 81379937
2598 81379938
2599 81379939
259A 81379A30
259B 81379A31
259C 81379A32
259D 81379A33
259E 81379A34
259F 81379A35
2FFC 8139A332
2FFD 8139A333
2FFE 8139A334
2FFF 8139A335
309F 8139A733
30A0 8139A734
30FF 8139A830
3100 8139A831
3101 8139A832
3102 8139A833
3103 8139A834
3104 8139A835
9FA6 82358F33
9FA7 82358F34
9FA8 82358F35
9FA9 82358F36
9FAA 82358F37
9FAB 82358F38
9FAC 82358F39
9FAD 82359030
9FAE 82359031
9FAF 82359032
9FB0 82359033
9FB1 82359034
9FB2 82359035
9FB3 82359036
9FB4 82359037
9FB5 82359038
9FB6 82359039
9FB7 82359130
9FB8 82359131
9FB9 82359132
9FBA 82359133
9FBB 82359134
9FBC 82359135
9FBD 82359136
9FBE 82359137
9FBF 82359138
9FC0 82359139
9FC1 82359230
9FC2 82359231
9FC3 82359232
9FC4 82359233
9FC5 82359234
9FC6 82359235
9FC7 82359236
9FC8 82359237
9FC9 82359238
9FCA 82359239
9FCB 82359330
9FCC 82359331
9FCD 82359332
9FCE 82359333
9FCF 82359334
9FD0 82359335
9FD1 82359336
9FD2 82359337
9FD3 82359338
9FD4 82359339
9FD5 82359430
9FD6 82359431
9FD7 82359432
9FD8 82359433
9FD9 82359434
9FDA 82359435
9FDB 82359436
9FDC 82359437
9FDD 82359438
9FDE 82359439
9FDF 82359530
9FE0 82359531
9FE1 82359532
9FE2 82359533
9FE3 82359534
9FE4 82359535
9FE5 82359536
9FE6 82359537
9FE7 82359538
9FE8 82359539
9FE9 82359630
9FEA 82359631
9FEB 82359632
9FEC 82359633
9FED 82359634
9FEE 82359635
9FEF 82359636
9FF0 82359637
9FF1 82359638
9FF2 82359639
9FF3 82359730
9FF4 82359731
9FF5 82359732
9FF6 82359733
9FF7 82359734
9FF8 82359735
9FF9 82359736
9FFA 82359737
9FFB 82359738
9FFC 82359739
9FFD 82359830
9FFE 82359831
9FFF 82359832
A000 82359833
D7A4 8336BE37
D7A5 8336BE38
D7A6 8336BE39
D7A7 8336BF30
D7A8 8336BF31
D7A9 8336BF32
D7AA 8336BF33
D7AB 8336BF34
D7AC 8336BF35
D7AD 8336BF36
D7AE 8336BF37
D7AF 8336BF38
D7B0 8336BF39
D7B1 8336C030
D7B2 8336C031
D7B3 8336C032
D7B4 8336C033
D7B5 8336C034
D7B6 8336C035
D7B7 8336C036
D7B8 8336C037
D7B9 8336C038
D7BA 8336C039
D7BB 8336C130
D7BC 8336C131
D7BD 8336C132
D7BE 8336C133
D7BF 8336C134
D7C0 8336C135
D7C1 8336C136
D7C2 8336C137
D7C3 8336C138
D7C4 8336C139
D7C5 8336C230
D7C6 8336C231
D7C7 8336C232
D7C8 8336C233
D7C9 8336C234
D7CA 8336C235
D7CB 8336C236
D7CC 8336C237
D7CD 8336C238
D7CE 8336C239
D7CF 8336C330
D7D0 8336C331
D7D1 8336C332
D7D2 8336C333
D7D3 8336C334
D7D4 8336C335
D7D5 8336C336
D7D6 8336C337
D7D7 8336C338
D7D8 8336C339
D7D9 8336C430
D7DA 8336C431
D7DB 8336C432
D7DC 8336C433
D7DD 8336C434
D7DE 8336C435
D7DF 8336C436
D7E0 8336C437
D7E1 8336C438
D7E2 8336C439
D7E3 8336C530
D7E4 8336C531
D7E5 8336C532
D7E6 8336C533
D7E7 8336C534
D7E8 8336C535
D7E9 8336C536
D7EA 8336C537
D7EB 8336C538
D7EC 8336C539
D7ED 8336C630
D7EE 8336C631
D7EF 8336C632
D7F0 8336C633
D7F1 8336C634
D7F2 8336C635
D7F3 8336C636
D7F4 8336C637
D7F5 8336C638
D7F6 8336C639
D7F7 8336C730
D7F8 8336C731
D7F9 8336C732
D7FA 8336C733
D7FB 8336C734
D7FC 8336C735
D7FD 8336C736
D7FE 8336C737
D7FF 8336C738
FA2E 84309D32
FA2F 84309D33
FA30 84309D34
FA31 84309D35
FA32 84309D36
FA33 84309D37
FA34 84309D38
FA35 84309D39
FA36 84309E30
FA37 84309E31
FA38 84309E32
FA39 84309E33
FA3A 84309E34
FA3B 84309E35
FA3C 84309E36
FA3D 84309E37
FA3E 84309E38
FA3F 84309E39
FA40 84309F30
FA41 84309F31
FA42 84309F32
FA43 84309F33
FA44 84309F34
FA45 84309F35
FA46 84309F36
FA47 84309F37
FA48 84309F38
FA49 84309F39
FA4A 8430A030
FA4B 8430A031
FA4C 8430A032
FA4D 8430A033
FA4E 8430A034
FA4F 8430A035
FA50 8430A036
FA51 8430A037
FA52 8430A038
FA53 8430A039
FA54 8430A130
FA55 8430A131
FA56 8430A132
FA57 8430A133
FA58 8430A134
FA59 8430A135
FA5A 8430A136
FA5B 8430A137
FA5C 8430A138
FA5D 8430A139
FA5E 8430A230
FA5F 8430A231
FA60 8430A232
FA61 8430A233
FA62 8430A234
FA63 8430A235
FA64 8430A236
FA65 8430A237
FA66 8430A238
FA67 8430A239
FA68 8430A330
FA69 8430A331
FA6A 8430A332
FA6B 8430A333
FA6C 8430A334
FA6D 8430A335
FA6E 8430A336
FA6F 8430A337
FA70 8430A338
FA71 8430A339
FA72 8430A430
FA73 8430A431
FA74 8430A432
FA75 8430A433
FA76 8430A434
FA77 8430A435
FA78 8430A436
FA79 8430A437
FA7A 8430A438
FA7B 8430A439
FA7C 8430A530
FA7D 8430A531
FA7E 8430A532
FA7F 8430A533
FA80 8430A534
FA81 8430A535
FA82 8430A536
FA83 8430A537
FA84 8430A538
FA85 8430A539
FA86 8430A630
FA87 8430A631
FA88 8430A632
FA89 8430A633
FA8A 8430A634
FA8B 8430A635
FA8C 8430A636
FA8D 8430A637
FA8E 8430A638
FA8F 8430A639
FA90 8430A730
FA91 8430A731
FA92 8430A732
FA93 8430A733
FA94 8430A734
FA95 8430A735
FA96 8430A736
FA97 8430A737
FA98 8430A738
FA99 8430A739
FA9A 8430A830
FA9B 8430A831
FA9C 8430A832
FA9D 8430A833
FA9E 8430A834
FA9F 8430A835
FAA0 8430A836
FAA1 8430A837
FAA2 8430A838
FAA3 8430A839
FAA4 8430A930
FAA5 8430A931
FAA6 8430A932
FAA7 8430A933
FAA8 8430A934
FAA9 8430A935
FAAA 8430A936
FAAB 8430A937
FAAC 8430A938
FAAD 8430A939
FAAE 8430AA30
FAAF 8430AA31
FAB0 8430AA32
FAB1 8430AA33
FAB2 8430AA34
FAB3 8430AA35
FAB4 8430AA36
FAB5 8430AA37
FAB6 8430AA38
FAB7 8430AA39
FAB8 8430AB30
FAB9 8430AB31
FABA 8430AB32
FABB 8430AB33
FABC 8430AB34
FABD 8430AB35
FABE 8430AB36
FABF 8430AB37
FAC0 8430AB38
FAC1 8430AB39
FAC2 8430AC30
FAC3 8430AC31
FAC4 8430AC32
FAC5 8430AC33
FAC6 8430AC34
FAC7 8430AC35
FAC8 8430AC36
FAC9 8430AC37
FACA 8430AC38
FACB 8430AC39
FACC 8430AD30
FACD 8430AD31
FACE 8430AD32
FACF 8430AD33
FAD0 8430AD34
FAD1 8430AD35
FAD2 8430AD36
FAD3 8430AD37
FAD4 8430AD38
FAD5 8430AD39
FAD6 8430AE30
FAD7 8430AE31
FAD8 8430AE32
FAD9 8430AE33
FADA 8430AE34
FADB 8430AE35
FADC 8430AE36
FADD 8430AE37
FADE 8430AE38
FADF 8430AE39
FAE0 8430AF30
FAE1 8430AF31
FAE2 8430AF32
FAE3 8430AF33
FAE4 8430AF34
FAE5 8430AF35
FAE6 8430AF36
FAE7 8430AF37
FAE8 8430AF38
FAE9 8430AF39
FAEA 8430B030
FAEB 8430B031
FAEC 8430B032
FAED 8430B033
FAEE 8430B034
FAEF 8430B035
FAF0 8430B036
FAF1 8430B037
FAF2 8430B038
FAF3 8430B039
FAF4 8430B130
FAF5 8430B131
FAF6 8430B132
FAF7 8430B133
FAF8 8430B134
FAF9 8430B135
FAFA 8430B136
FAFB 8430B137
FAFC 8430B138
FAFD 8430B139
FAFE 8430B230
FAFF 8430B231
FB07 8430B239
FB08 8430B330
FB09 8430B331
FB0A 8430B332
FB0B 8430B333
FB0C 8430B334
FB0D 8430B335
FB0E 8430B336
FB0F 8430B337
FB10 8430B338
FB11 8430B339
FB12 8430B430
FB18 8430B436
FB19 8430B437
FB1A 8430B438
FB1B 8430B439
FB1C 8430B530
FB37 8430B737
FB3D 8430B833
FB3F 8430B835
FB42 8430B838
FB45 8430B931
FBB2 8430C430
FBB3 8430C431
FBB4 8430C432
FBB5 8430C433
FBB6 8430C434
FBB7 8430C435
FBB8 8430C436
FBB9 8430C437
FBBA 8430C438
FBBB 8430C439
FBBC 8430C530
FBBD 8430C531
FBBE 8430C532
FBBF 8430C533
FBC0 8430C534
FBC1 8430C535
FBC2 8430C536
FBC3 8430C537
FBC4 8430C538
FBC5 8430C539
FBC6 8430C630
FBC7 8430C631
FBC8 8430C632
FBC9 8430C633
FBCA 8430C634
FBCB 8430C635
FBCC 8430C636
FBCD 8430C637
FBCE 8430C638
FBCF 8430C639
FBD0 8430C730
FBD1 8430C731
FBD2 8430C732
FD40 8430EB38
FD41 8430EB39
FD42 8430EC30
FD43 8430EC31
FD44 8430EC32
FD45 8430EC33
FD46 8430EC34
FD47 8430EC35
FD48 8430EC36
FD49 8430EC37
FD4A 8430EC38
FD4B 8430EC39
FD4C 8430ED30
FD4D 8430ED31
FD4E 8430ED32
FD4F 8430ED33
FD90 8430F338
FD91 8430F339
FDC8 8430F934
FDC9 8430F935
FDCA 8430F936
FDCB 8430F937
FDCC 8430F938
FDCD 8430F939
FDCE 8430FA30
FDCF 8430FA31
FDD0 8430FA32
FDD1 8430FA33
FDD2 8430FA34
FDD3 8430FA35
FDD4 8430FA36
FDD5 8430FA37
FDD6 8430FA38
FDD7 8430FA39
FDD8 8430FB30
FDD9 8430FB31
FDDA 8430FB32
FDDB 8430FB33
FDDC 8430FB34
FDDD 8430FB35
FDDE 8430FB36
FDDF 8430FB37
FDE0 8430FB38
FDE1 8430FB39
FDE2 8430FC30
FDE3 8430FC31
FDE4 8430FC32
FDE5 8430FC33
FDE6 8430FC34
FDE7 8430FC35
FDE8 8430FC36
FDE9 8430FC37
FDEA 8430FC38
FDEB 8430FC39
FDEC 8430FD30
FDED 8430FD31
FDEE 8430FD32
FDEF 8430FD33
FDFC 8430FE36
FDFD 8430FE37
FDFE 8430FE38
FDFF 8430FE39
FE00 84318130
FE01 84318131
FE02 84318132
FE03 84318133
FE04 84318134
FE05 84318135
FE06 84318136
FE07 84318137
FE08 84318138
FE09 84318139
FE0A 84318230
FE0B 84318231
FE0C 84318232
FE0D 84318233
FE0E 84318234
FE0F 84318235
FE10 84318236
FE11 84318237
FE12 84318238
FE13 84318239
FE14 84318330
FE15 84318331
FE16 84318332
FE17 84318333
FE18 84318334
FE19 84318335
FE1A 84318336
FE1B 84318337
FE1C 84318338
FE1D 84318339
FE1E 84318430
FE1F 84318431
FE24 84318436
FE25 84318437
FE26 84318438
FE27 84318439
FE28 84318530
FE29 84318531
FE2A 84318532
FE2B 84318533
FE2C 84318534
FE2D 84318535
FE2E 84318536
FE2F 84318537
FE45 84318539
FE46 84318630
FE47 84318631
FE48 84318632
FE53 84318633
FE67 84318635
FE6C 84318636
FE6D 84318637
FE6E 84318638
FE6F 84318639
FE73 84318733
FE75 84318735
FEFD 84319531
FEFE 84319532
FF00 84319534
FF5F 84319535
FF60 84319536
FFBF 84319F31
FFC0 84319F32
FFC1 84319F33
FFC8 8431A030
FFC9 8431A031
FFD0 8431A038
FFD1 8431A039
FFD8 8431A136
FFD9 8431A137
FFDD 8431A231
FFDE 8431A232
FFDF 8431A233
FFE0 A1E9
FFE7 8431A235
FFEF 8431A333
FFF0 8431A334
FFF1 8431A335
FFF2 8431A336
FFF3 8431A337
FFF4 8431A338
FFF5 8431A339
FFF6 8431A430
FFF7 8431A431
FFF8 8431A432
FFFE 8431A438
FFFF 8431A439
===== End of TABLE =====
Actual results:
03A2 8130CB31 - unmatch code: GB18030=>Uni: 391
2596 81379936 - unmatch code: GB18030=>Uni: 2593
2597 81379937 - unmatch code: GB18030=>Uni: 2594
2598 81379938 - unmatch code: GB18030=>Uni: 2595
2599 81379939 - unmatch code: GB18030=>Uni: 2596
259A 81379A30 - unmatch code: GB18030=>Uni: 2597
259B 81379A31 - unmatch code: GB18030=>Uni: 2598
259C 81379A32 - unmatch code: GB18030=>Uni: 2599
259D 81379A33 - unmatch code: GB18030=>Uni: 259a
259E 81379A34 - unmatch code: GB18030=>Uni: 259b
259F 81379A35 - unmatch code: GB18030=>Uni: 259c
2FFC 8139A332 - unmatch code: Uni=>GB18030:
2FFC 8139A332 - unmatch code: GB18030=>Uni: 2ff0
2FFD 8139A333 - unmatch code: Uni=>GB18030:
2FFD 8139A333 - unmatch code: GB18030=>Uni: 2ff1
2FFE 8139A334 - unmatch code: Uni=>GB18030:
2FFE 8139A334 - unmatch code: GB18030=>Uni: 2ff2
2FFF 8139A335 - unmatch code: Uni=>GB18030:
2FFF 8139A335 - unmatch code: GB18030=>Uni: 2ff3
309F 8139A733 - unmatch code: GB18030=>Uni: 309b
30A0 8139A734 - unmatch code: GB18030=>Uni: 309c
30FF 8139A830 - unmatch code: GB18030=>Uni: 30fc
3100 8139A831 - unmatch code: GB18030=>Uni: 30fd
3101 8139A832 - unmatch code: GB18030=>Uni: 30fe
3102 8139A833 - unmatch code: GB18030=>Uni: 30ff
3103 8139A834 - unmatch code: GB18030=>Uni: 3100
3104 8139A835 - unmatch code: GB18030=>Uni: 3101
9FA6 82358F33 - unmatch code: Uni=>GB18030:
9FA7 82358F34 - unmatch code: Uni=>GB18030:
9FA8 82358F35 - unmatch code: Uni=>GB18030:
9FA9 82358F36 - unmatch code: Uni=>GB18030:
9FAA 82358F37 - unmatch code: Uni=>GB18030:
9FAB 82358F38 - unmatch code: Uni=>GB18030:
9FAC 82358F39 - unmatch code: Uni=>GB18030:
9FAD 82359030 - unmatch code: Uni=>GB18030:
9FAE 82359031 - unmatch code: Uni=>GB18030:
9FAF 82359032 - unmatch code: Uni=>GB18030:
9FB0 82359033 - unmatch code: Uni=>GB18030:
9FB1 82359034 - unmatch code: Uni=>GB18030:
9FB2 82359035 - unmatch code: Uni=>GB18030:
9FB3 82359036 - unmatch code: Uni=>GB18030:
9FB4 82359037 - unmatch code: Uni=>GB18030:
9FB5 82359038 - unmatch code: Uni=>GB18030:
9FB6 82359039 - unmatch code: Uni=>GB18030:
9FB7 82359130 - unmatch code: Uni=>GB18030:
9FB8 82359131 - unmatch code: Uni=>GB18030:
9FB9 82359132 - unmatch code: Uni=>GB18030:
9FBA 82359133 - unmatch code: Uni=>GB18030:
9FBB 82359134 - unmatch code: Uni=>GB18030:
9FBC 82359135 - unmatch code: Uni=>GB18030:
9FBD 82359136 - unmatch code: Uni=>GB18030:
9FBE 82359137 - unmatch code: Uni=>GB18030:
9FBF 82359138 - unmatch code: Uni=>GB18030:
9FC0 82359139 - unmatch code: Uni=>GB18030:
9FC1 82359230 - unmatch code: Uni=>GB18030:
9FC2 82359231 - unmatch code: Uni=>GB18030:
9FC3 82359232 - unmatch code: Uni=>GB18030:
9FC4 82359233 - unmatch code: Uni=>GB18030:
9FC5 82359234 - unmatch code: Uni=>GB18030:
9FC6 82359235 - unmatch code: Uni=>GB18030:
9FC7 82359236 - unmatch code: Uni=>GB18030:
9FC8 82359237 - unmatch code: Uni=>GB18030:
9FC9 82359238 - unmatch code: Uni=>GB18030:
9FCA 82359239 - unmatch code: Uni=>GB18030:
9FCB 82359330 - unmatch code: Uni=>GB18030:
9FCC 82359331 - unmatch code: Uni=>GB18030:
9FCD 82359332 - unmatch code: Uni=>GB18030:
9FCE 82359333 - unmatch code: Uni=>GB18030:
9FCF 82359334 - unmatch code: Uni=>GB18030:
9FD0 82359335 - unmatch code: Uni=>GB18030:
9FD1 82359336 - unmatch code: Uni=>GB18030:
9FD2 82359337 - unmatch code: Uni=>GB18030:
9FD3 82359338 - unmatch code: Uni=>GB18030:
9FD4 82359339 - unmatch code: Uni=>GB18030:
9FD5 82359430 - unmatch code: Uni=>GB18030:
9FD6 82359431 - unmatch code: Uni=>GB18030:
9FD7 82359432 - unmatch code: Uni=>GB18030:
9FD8 82359433 - unmatch code: Uni=>GB18030:
9FD9 82359434 - unmatch code: Uni=>GB18030:
9FDA 82359435 - unmatch code: Uni=>GB18030:
9FDB 82359436 - unmatch code: Uni=>GB18030:
9FDC 82359437 - unmatch code: Uni=>GB18030:
9FDD 82359438 - unmatch code: Uni=>GB18030:
9FDE 82359439 - unmatch code: Uni=>GB18030:
9FDF 82359530 - unmatch code: Uni=>GB18030:
9FE0 82359531 - unmatch code: Uni=>GB18030:
9FE1 82359532 - unmatch code: Uni=>GB18030:
9FE2 82359533 - unmatch code: Uni=>GB18030:
9FE3 82359534 - unmatch code: Uni=>GB18030:
9FE4 82359535 - unmatch code: Uni=>GB18030:
9FE5 82359536 - unmatch code: Uni=>GB18030:
9FE6 82359537 - unmatch code: Uni=>GB18030:
9FE7 82359538 - unmatch code: Uni=>GB18030:
9FE8 82359539 - unmatch code: Uni=>GB18030:
9FE9 82359630 - unmatch code: Uni=>GB18030:
9FEA 82359631 - unmatch code: Uni=>GB18030:
9FEB 82359632 - unmatch code: Uni=>GB18030:
9FEC 82359633 - unmatch code: Uni=>GB18030:
9FED 82359634 - unmatch code: Uni=>GB18030:
9FEE 82359635 - unmatch code: Uni=>GB18030:
9FEF 82359636 - unmatch code: Uni=>GB18030:
9FF0 82359637 - unmatch code: Uni=>GB18030:
9FF1 82359638 - unmatch code: Uni=>GB18030:
9FF2 82359639 - unmatch code: Uni=>GB18030:
9FF3 82359730 - unmatch code: Uni=>GB18030:
9FF4 82359731 - unmatch code: Uni=>GB18030:
9FF5 82359732 - unmatch code: Uni=>GB18030:
9FF6 82359733 - unmatch code: Uni=>GB18030:
9FF
- duplicates
-
JDK-4604627 native2ascii has problem converting GB18030 file
-
- Closed
-
- relates to
-
JDK-4618289 The reverse convert have some error on two codepoint for gb18030
-
- Closed
-