转换一下,string.getBytes("ISO8859-1")
解决方案 »
- jpivot+mondrian制作的报表如何实现分页与表头冻结
- hibernate 的自增长主键是否不能改。
- jsp iframe 问题
- 散分 顺便问下js怎么得到动态表格某一行的id值?
- js为什么验证不成功?大侠帮忙!
- 还是从.xml文件中导入到数据库的问题,昨天那位大虾在给下支持!
- 如何解决项目中,需要从数据库中读取大量数据,然后以*.xls文件输出的性能问题
- jsp第二页如何接收第一页中的<select> 的显示值,而不是<select>的value? 在线等,急!
- 文件问题!(只有30分了)
- 谁来帮我看看这是什么错误?
- [网易精英招聘]版面的bug问题,欢迎各位讨论~~~~~
- 在线求救
String trans(String chi)
{
String result = null;
byte temp [];
try
{
temp=chi.getBytes("iso-8859-1");
result = new String(temp,"GBK");
}
catch(UnsupportedEncodingException e)
{
System.out.println (e.toString());
}
return result;
}
String 参数为读出来的数据
request.setCharacterEncoding(“UTF-8”);
request.getParameter("value").getBytes("8859_1"),"gb2312");
转换输出信息字符集
new String(str.getBytes("GB2312"),"ISO-8859-1");
new String(str.getBytes(" ISO-8859-1 "),“GBK");
request.setCharacterEncoding("UTF-8");
读取数据库数据
str=new String(str.getBytes("GB2312"));
插入数据库数据
str=new String(str.getBytes("ISO-8859-1"));