String plain = "你好";
byte[] bytes = plain.getBytes("utf-8");
byte[] bytes2 = new String(bytes, "utf-8").getBytes("gbk");
plain=new String(bytes2, "gbk");
java中字符串 utf8 转为 gbk
最新推荐文章于 2024-07-15 02:38:31 发布
String plain = "你好";
byte[] bytes = plain.getBytes("utf-8");
byte[] bytes2 = new String(bytes, "utf-8").getBytes("gbk");
plain=new String(bytes2, "gbk");