如何将中文字符号写入unix下的一个文本文件

chenz 2003-10-19 05:18:28
各位高手:
我用JSP将中文字符写入unix下的一个文本文件,然后通过连接的方式让客户下载到WINDOW,始终不能得到中文,请问如何解决?谢谢!
原码是这样的
String path =pageContext.getServletContext().getRealPath("/download/");
path = path+File.separator + "personlist1.txt";
FileWriter theFile = new FileWriter(path,false);
PrintWriter aout=new PrintWriter(theFile);
String person="你好";
person =new String(person.getBytes("ISO8859_1"),"GB2312");
aout.println(person);
aout.close();
theFile.close();
链接是<A href="../download/personlist1.txt">成员清单下载</A>
...全文
34 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

81,091

社区成员

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

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