• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

₪ character displayed as ?

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am fetching a certain String from the Database which also contains this special character: ₪ (it is the coin sign for the Israeli shekel, the same as $ for the US).
The problem is that these characters appear on the screen as ? instead of ₪. At the Database itself they appear as they should: ₪. Which manipulation should be done on the string in order to present it correctly?
[ October 31, 2006: Message edited by: Roy Cohen ]
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depends how you are making them appear on the screen. Whatever applicaiton you are using to make them appear needs to be using a character set that supports the shekel. Have a read of this.
 
Andrew Carney
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

I am familiar with this link, I am indeed saving it as an HTML with UTF-8 but it doesn't help. I did try a different thing now:
I created a simple static HTML file using editplus and entered the sign into it.
When I saved this file editplus announced me that I have characters that can be lost using the current encoding and when I select to save the file using 'Unicode' encoding I can see the sign on the HTML page.
This change that editplus made did not affect the HTML code, so I assume I need to save the HTML file I am writing into in a 'Unicode' encoding.
Could you please suggest me how to do it in Java?

Thank you in advance,
Roy
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JVM has a property called file.encoding which defines which encoding is used when streaming out to a file. Unless you tell it otherwise it will use this encoding. Have a look at OutputStreamWriter - it has various constructors that allow you to specify the character set to use. Make it UTF-8 or whatever and you should be OK.
 
Andrew Carney
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeh you are right, I've changed it to UTF-16 and it solved the problem, 10X!
 
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic