Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java application - problem export hebrew to file  RSS feed

 
Tizki Ko
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

when i export hebrew strings to file (text file), i get question marks instead of hebrew letters.

can you help me fix this?

thanks.
tizki
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tizki Ko wrote:
when i export hebrew strings to file (text file), i get question marks instead of hebrew letters.


What are you using to read and view the file with?
 
Tizki Ko
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply.
i tried notepad, wordpad, microsoft word 2007, all give the same result: question marks.
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which encoding / charset are you using when writing to the file?
 
Tizki Ko
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i thought that java is utf-8 by default....
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it uses the system encoding by default. You can see which one that is with the following line:
 
Tizki Ko
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks,
i get "windows 1252".
do i need to change it?
how do i do that?

thanks,
tizki
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if Windows-1252 supports Hebrew; you may want to verify that. You can use UTF-8 through something like

new OutputStreamWriter(new FileOutputStream(...), "UTF-8")
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!