String a = "/.;"; String s1 = new String(a.getBytes(),"UTF-8"); System.out.println(a.equals(s1)); String b = "哈哈"; String s2 = new String(b.getBytes(),"gbk"); System.out.println(b.equals(s2));
Please refer to: http://blog.csdn.net/justinavril/archive/2008/08/07/2783266.aspx This page will tell you how to detect the String Encoding.
String a = "/.;";
String s1 = new String(a.getBytes(),"UTF-8");
System.out.println(a.equals(s1));
String b = "哈哈";
String s2 = new String(b.getBytes(),"gbk");
System.out.println(b.equals(s2));
http://blog.csdn.net/justinavril/archive/2008/08/07/2783266.aspx
This page will tell you how to detect the String Encoding.