Here is a program:
String a = new string ("Ace");
String b = new string (A.GetByte (), "ISO8859_1");
String c = new string (A.GetByte (), "GB2312");
System.out.println ("b =" b "c =" c);
String B = New String (B.GetByte ("ISO8859_1"), "GBK");
String C = New String (A.GetByte ("GB2312"), "GBK");
System.out.println ("b =" b "c =" c);
The internal code of the virtual machine is GBK:
The output result is:
B = ?? c = ??
b = Acer C = ??
This is a wonderful place.
When A is converted to GB2312, since the corresponding encoding is not found in the coded table, it is replaced with the encoding, and then it is back.
When it is converted to ISO8859_1, the encoding is translated in the past, although it is not normal to display, it guarantees that normal conversion is returned.
ISO8859_1 is a more special character set, which is an 8-bit encoding, which makes him become a very good intermediary, which will be faithful to record each byte data without changing, and it is estimated that this is web transmission and JDBC transmission uses it as a character set.