import java.io.IOException;
import java.io.UnsupportedEncodingException;
public class ConvertUnicode {
public static void main(String arg[]) throws IOException{
String str1 = "\u6237\u767B";
String str2 = new String(str1.getBytes("GB2312"));
System.out.println(str2);
}
}
import java.io.UnsupportedEncodingException;
public class ConvertUnicode {
public static void main(String arg[]) throws IOException{
String str1 = "\u6237\u767B";
String str2 = new String(str1.getBytes("GB2312"));
System.out.println(str2);
}
}
本文提供了一个 Java 示例程序,演示如何将 Unicode 编码的字符串转换为 GB2312 编码。通过具体的代码实现,读者可以了解不同字符集之间的转换方法。
100

被折叠的 条评论
为什么被折叠?



