Name: nl37777 Date: 12/08/98
JDK Version:
java version "1.2"
Classic VM (build JDK-1.2-U, green threads, sunwjit)
String var1 = new String( bvar, "ISO2022CN_GB") causes exception.
Program that reproduces problem:
import java.util.*;
public class test2 {
public static void main(String[] args)
{
try {
String var0 = new String("any string");
byte[] bvar = var0.getBytes("ISO2022CN_GB"); //works
//byte[] bvar = var0.getBytes("ISO2022KR"); //works
String uniString = new String(bvar, "ISO2022CN_GB"); //does not work
//String uniString = new String(bvar, "ISO2022KR"); //works
System.out.println("Unicode String= " + uniString);
}
catch (Exception e)
{
System.out.println("ERROR: " + e.getMessage());
}
}
}
Error returned is:
$java test2
ERROR: ISO2022CN_GB
(Review ID: 47367)
======================================================================