wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes [Solved] Encoding Greek chars in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "[Solved] Encoding Greek chars in Java" Watch "[Solved] Encoding Greek chars in Java" New topic
Author

[Solved] Encoding Greek chars in Java

Eva Lin
Greenhorn

Joined: Jan 10, 2010
Posts: 9
Hi guys!
I am using the following function that belongs in java.net.URL; library:

x = new URL(url);
in = new BufferedReader(new InputStreamReader(x.openStream()));

but it doesn't seems to work with Greek chars!
Actually, all the Greek chars are automatically been transformed into squares!

What can I do?
Any help appreciated.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19684
    
  20

Check out the other InputStreamReader constructors. You will need to set a specific encoding that supports Greek.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Eva Lin
Greenhorn

Joined: Jan 10, 2010
Posts: 9
Many many thanks!

I just edited the following line:
in = new BufferedReader(new InputStreamReader(x.openStream()));

to this one:
in = new BufferedReader(new InputStreamReader(x.openStream(), "windows-1253"));
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Solved] Encoding Greek chars in Java