
2008-7-17 12:05
juanpeng
JAVA字符编解码问题
String strChina="中国";
byte buf[]=strChina.getBytes("ISO8859-1");
System.out.println(buf.length);
String str=new String(buf,0,buf.length);
System.out.println(str);
String str1=new String(str.getBytes("ISO8859-1"),"gb2312");
System.out.println(str1);
为什么str1输出是乱码呢?我已经转化了啊
2008-7-17 12:06
juan002
你看一下这里写的!
[url]http://blog.csdn.net/rascalboy520/archive/2008/06/06/2516038.aspx[/url]
2008-7-17 12:06
juan002
这个你要放到页面格式为gb2312的页面里时才能正常显示,
2008-7-17 12:14
it01
日 互搏
2008-7-17 12:35
justforregister
呵呵
2008-7-17 17:05
easier_wjh
啥情况啊
页:
[1]

Powered by ITPUB论坛