• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Solved] Encoding Greek chars in Java

 
Eva Lin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the other InputStreamReader constructors. You will need to set a specific encoding that supports Greek.
 
Eva Lin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"));
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic