Posted By:
Stephen_Ostermiller
Posted On:
Wednesday, November 20, 2002 03:45 AM
Your problem is with the line:
new FileReader (v.get(k).toString())
FileReader assumes that the file is in the character set of the platform you are using. This is probably not the case unless you are using a chinese computer.
You probably want something along the lines:
new InputStreamReader(new FileInputStream(v.get(k).toString()), "GB2312");
That is just a primer on how to read files into strings in an international fashion. It is not clear to me why you are using strings at all. Zip is meant to work on bytes. It seems to me that if you read in bytes and zipped bytes, you wouldn't have to worry about the contents of the file. The file would be zipped properly no matter what its character set is, or even if it is a binary file.