greek and spanish chars are not properly displayed with UTF8 in jdk1.4

The following code is to write greece and spanish characters to a datafille on solaris platform. and download the datafile onto windows system

String str3 = FileDataObject.getFcName().equalsIgnoreCase("GREECE") ? "8859_7": System.getProperty("file.encoding");

// FileDataObject represents greek and spanish characters

// values of File DataObject are written to datafile

out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileNameList.getNameAt(k),false),str3)));

out.print("|HEADER|");

out.print(FileDataObject.getTransactionType()+"|");

out.print(""+FileDataObject.getFcName()+"|");

out.print(""+currentDate+"|");

This code was working fiine with jdk1.2on solaris platform ,

for jdk 1.2i was able to display all spanish and greek characters in MS word template.

but when i moved tojdk1.4.2 on solaris platform , some of the spanish chracters are replaced by '?'and , greek characters are totally replaced by some funny characters.

i tried to move to UTF-8 encoding even then nothing is working for me.

looking forward for ur valuable suggestions for the above problem

[1207 byte] By [SaiDevaa] at [2007-10-2 16:57:26]
# 1
Have you used a hex editor to check whether the file is correct? My guess is that the problem is the means you're using to check the file rather than the file per se.
YAT_Archivista at 2007-7-13 18:10:21 > top of Java-index,Desktop,I18N...
# 2

thks for ur reply.

i was able to understand the problem , it was because of zipping the files.

when iam zipping the files , character set is lost ,

i tried even withsetEncoding method of ZIPOutput stream , even then it is not working,

can u suggest me any other alternative to ZIP, so that spanish and greek are not lost

SaiDevaa at 2007-7-13 18:10:21 > top of Java-index,Desktop,I18N...
# 3

> when iam zipping the files , character set is lost ,

It is even lost without zipping it. It is not written to the file, the charset defines how the Java characters are mapped to a sequence of bytes. It is up to the reading party to interpret a (text) file, to assume some character encoding.

What about writing an HTML file? It can contain in the header in a standard way a hint to the encoding so the reading party will not have to assume it.

BIJ001a at 2007-7-13 18:10:21 > top of Java-index,Desktop,I18N...