resin和中文乱码?

wyb_45 2003-10-20 01:58:19
resin中文支持的应该很好,
在HP Unix的resin可以中英文混合编程
但是在Windows上有问题
windows XP
resin-2.1.11
j2sdk1.4.2
例如
文件hello1.jsp
<html>
<body>
<p>
<%
String msg="你好 ddd";
out.println(msg);
%>
</body>
</html>
</body>
</html>
--显示很好
文件helllo2.jsp
<html>
<body>
<p>你好hello</p>
</body>
</html>
--中文显示也很好
但是
文件hello3.jsp
<html>
<body>
<p>
<p>你好hello</p>
<%
String msg="你好 ddd";
out.println(msg);
%>
</body>
</html>
就出现乱码了。
怎么解决呢?

...全文
151 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
noratong 2003-10-20
  • 打赏
  • 举报
回复
那是字符集的原因。跟系统的字符集有关。
dike103 2003-10-20
  • 打赏
  • 举报
回复
<%@ page contentType="text/html; charset=gb2312" %>
这个在你以后的程序中都要在前面加上才可以
要养成习惯
wyb_45 2003-10-20
  • 打赏
  • 举报
回复
果然是这样,给分
OK
那是怎么回事呢?
HP Unix上的可不用呀
newfox 2003-10-20
  • 打赏
  • 举报
回复
加上...
<%@ page contentType="text/html; charset=gb2312" %>
就可以了.
hongsea312 2003-10-20
  • 打赏
  • 举报
回复
在代码头部加上这句话:

<%@ page contentType="text/html;charset=gb2312"%>

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧