给你一个转换类public class CharsetProcess { public CharsetProcess() {
}
public static void main(String[] args) {
CharsetProcess charsetProcess1 = new CharsetProcess();
} public static String U2C(String s)
{
String str = s;
try
{
if ( str == null ) return str;
byte[] u = str.getBytes("iso-8859-1");
return new String(u,"GB2312");
}
catch(java.io.UnsupportedEncodingException e)
{
e.printStackTrace();
return str;
} }}
}
public static void main(String[] args) {
CharsetProcess charsetProcess1 = new CharsetProcess();
} public static String U2C(String s)
{
String str = s;
try
{
if ( str == null ) return str;
byte[] u = str.getBytes("iso-8859-1");
return new String(u,"GB2312");
}
catch(java.io.UnsupportedEncodingException e)
{
e.printStackTrace();
return str;
} }}
原来都是先把汉字转成unicode 如:/u3d23放在property文件的。
但这样很麻烦。现在也忘了怎么作的,谁能告诉我?
出不了啥
有他有啥用