zl程序教程

您现在的位置是:首页 >  后端

当前栏目

将\u之类的unicode字符变成gb2312字符的方法

字符方法 变成 Unicode 之类 GB2312
2023-09-27 14:22:10 时间
import java.io.IOException;
import java.io.UnsupportedEncodingException;




public class ConvertUnicode {
public static void main(String arg[]) throws IOException{
String str1 = "\u3010";
String str2 = new String(str1.getBytes("GB2312"));
System.out.println(str2);
}
}