linux下tomcat的中文问题,请帮忙看看!
我制作了一个新闻系统(jsp+javabean),其中有一个功能是生成静态的新闻页面,现在我通过以下语句(在javabean中):
......
File newfile=new File(filepath);
FileWriter resultfile=new FileWriter(newfile);
PrintWriter myfile=new PrintWriter(resultfile);
myfile.println(template);
resultfile.close();
将template(含有中文),写入了.html文件。
我在windows调试通过,但在linux下生成的静态文件都是乱码:????
但我在linux下将template输出到jsp页面,显示的是中文的。
在静态页面下我加了:<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
在jsp页面加了:<%@ page contentType="text/html;charset=gb2312" %>
我的tomcat版本是4.1.27
请高手帮我看看如何解决,是不是写入有问题!感激不尽!