permaculture playing cards*
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 Murach's Java Servlets and JSP this week in the Servlets 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

[Solved] Encoding Greek chars in Java

Eva Lin

Joined: Jan 10, 2010
Posts: 9
Hi guys!
I am using the following function that belongs in; 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

Joined: Oct 27, 2005
Posts: 19651

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

How To Ask Questions How To Answer Questions
Eva Lin

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"));
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: [Solved] Encoding Greek chars in Java
Similar Threads
Question from Exam lab practice Exam 1 about polymorphism
WA #1.....word association
How to convert string to mixed case
SimpleDateFormat problem....
jboss character encoding problem