So, how can i get the system encoding which is iso8859_15 not utf-8?
It seems that Systme.getProperty("file.encode") can't get the right encode.
Best Regards.
----- Original Message -----
From: jacky
To: [email protected]
Sent: Tuesday, January 10, 2006 4:44 PM
Subject: [fileupload] upload file with error encoding
hi,
linux redhat7.3 j2sdk1.4.2 Tomcat4.1.30, common-fileupload1.0
String docDestRelativePath = getPath(); //getPath() will generate the
relative path dynamicly
String docDestAbsPath =
getServletContext().getRealPath(docDestRelativePath);
File docDestAbsPathFile = new File(docDestAbsPath);
String relativePath = "test/4867.txt";
String path = getServletContext().getRealPath(relativePath) ;
File pathFile = new File(path);
abstractItem.write(pathFile); //line 1,
abstractItem.write(docDestAbsPathFile); //line 2
line 1 write the file with right encoding, but the line 2 write the file with
funny txt.
When using System.getProperty("file.encode") before line 1, after line 1 and
after line 2, all print utf-8. I think it maybe the encoding of tomcat
container because the encoding of my system is iso8859_15.
I don't know why this happens. What can i do to make the line 1 work? Thanks
for your help!
Best Regards.