1、URLEncoder
URLEncoder.encode("中国", "GBK");
2、String
String unicode = new String(utf8.getBytes(), "UTF-8"); // 解码
String utf8 = new String(t.getBytes( "UTF-8")); // 编码 String gbk = new String(unicode.getBytes("GBK")); // 编码
1、URLEncoder
URLEncoder.encode("中国", "GBK");
2、String
String unicode = new String(utf8.getBytes(), "UTF-8"); // 解码
String utf8 = new String(t.getBytes( "UTF-8")); // 编码 String gbk = new String(unicode.getBytes("GBK")); // 编码