This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 19654
    
  18

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"));
 
 
subject: [Solved] Encoding Greek chars in Java
 
Similar Threads
Question from Exam lab practice Exam 1 about polymorphism
How to convert string to mixed case
WA #1.....word association
SimpleDateFormat problem....
jboss character encoding problem