• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

java application - problem export hebrew to file

 
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
 
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.
 
Sheriff
Posts: 22042
113
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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: 22042
113
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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
 
Rancher
Posts: 43016
76
  • 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")
 
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic