This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Solved] Encoding Greek chars in Java

 
Eva Lin
Greenhorn
Posts: 9
  • 0
  • 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: 20381
46
Chrome Eclipse IDE Java Windows
  • 0
  • 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
  • 0
  • 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"));
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic