`
penghao122
  • 浏览: 356483 次
  • 性别: Icon_minigender_1
  • 来自: 广东珠海
社区版块
存档分类
最新评论

如果处理中文乱码问题(针对Tomcat)

阅读更多
在jsp输出中文

<%@page contentType="text/html;charset=utf-8"%>

or 在serverlet中

httprequest.setContentType("text/html;charset=utf-8")

<%

String str="中文";

byte[] temp =str.getBytes("ISO8859-1");
str= new String(temp);
out.print(str);
%>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics