we are not able to retain the greek characters after zipping the files(that contain greek characters). the following code shows u a clear sketch about how we are zipping the files on solaris platform. ZipOutputStream out = null; try {
out.putNextEntry(new ZipEntry(getFileName(fileNameLists.getNameAt(i)))); int c; while((c = in.read()) != -1) { out.write(c); } in.close(); } out.close(); if we are directly open the file which is stored in specified location its displaying greek characters(non-ascii) correctly but our application need to zip those files and save on windows platform. so once we zip the files and download onto windows platform and extract the files its shows some garbage characters(may be using default character encoding of windows cp1252) instead of greek charcaters.
we tried in many ways using the setEncoding("iso-8859-7") and setEncoding("UTF-8") method in ZipOutPutStream even then no use.
is it because that zip utility while reading takes default character encoding of the platform? wud be thankful if anyone cud provive solution for this
Mixing Reader and OutputStream without proper conversion is bad thing because Readers (and Writers) use characters (unicode) and Streams use bytes. [ April 26, 2006: Message edited by: Vlado Zajac ]
Mixing Reader and OutputStream without proper conversion is bad thing because Readers (and Writers) use characters (unicode) and Streams use bytes.
Actually the encoding used by readers depend on the encoding set in the System property "file.encoding". It is also possible to configure a reader to use another encoding, by means of the InputStreamReader and OutputStreamWriter constructors.
The problem actually looks like an encoding issue.
When saving characters by means of a Writer use the OutpuStreamWriter constructor that let's you define the enconding. And when getting the files back, use the InputStreamReader constructor with the same encoding.
Somewhat like this for writing the file:
And somewhat like this to read it back:
And I guess the zipping and uziping should no be an issue. [ April 26, 2006: Message edited by: Edwin Dalorzo ]