日期:2014-05-18  浏览次数:20552 次

头痛的中文转码,,,
https://jsjy.zsnet.com:8000/Interface/GetTopArticle.aspx?sn=0&count=1&type=1&id=000001

(tomcat容器下的SERVLET)读取里面的中文,,然后写入到TXT文件里面,,,老是中文乱码,,改怎样转啊...

------解决方案--------------------
指定编码格式。如:String param_value = new String(param_values[1].getBytes( "8859_1 "), "GBK ");
------解决方案--------------------
在论坛搜索 中文 应该可以找到你要的信息的

------解决方案--------------------
public String toGBK(String str) throws java.io.UnsupportedEncodingException
{
return new String(str.getBytes( "ISO-8859-1 "), "GBK ");
}