如何将中文字符号写入unix下的一个文本文件
chenz 2003-10-19 01:47:41 各位高手:
我用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>