美文网首页
java中文字符乱码编码转换大全【转】

java中文字符乱码编码转换大全【转】

作者: KtYY | 来源:发表于2017-08-01 11:03 被阅读0次
System.out.println(new String(myFileName.getBytes("gbk")));   
System.out.println(new String(myFileName.getBytes("utf-8"),"gbk"));
System.out.println(new String(myFileName.getBytes("iso-8859-1"),"gbk")); 
System.out.println(new String(myFileName.getBytes("gb2312"), "gbk"));
System.out.println(new String(myFileName.getBytes("utf-8")));   
System.out.println(new String(myFileName.getBytes("gbk"),"utf-8"));
System.out.println(new String(myFileName.getBytes("iso-8859-1"),"utf-8")); 
System.out.println(new String(myFileName.getBytes("gb2312"), "utf-8"));
System.out.println(new String(myFileName.getBytes("iso-8859-1")));   
System.out.println(new String(myFileName.getBytes("gbk"),"iso-8859-1"));
System.out.println(new String(myFileName.getBytes("utf-8"),"iso-8859-1")); 
System.out.println(new String(myFileName.getBytes("gb2312"), "iso-8859-1"));
System.out.println(new String(myFileName.getBytes("gb2312")));   
System.out.println(new String(myFileName.getBytes("gbk"),"gb2312"));
System.out.println(new String(myFileName.getBytes("utf-8"),"gb2312")); 
System.out.println(new String(myFileName.getBytes("iso-8859-1"), "gb2312"));

转自:http://m.blog.csdn.net/xwawa2012/article/details/39579627

相关文章

网友评论

      本文标题:java中文字符乱码编码转换大全【转】

      本文链接:https://www.haomeiwen.com/subject/abqjlxtx.html