This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
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 ]
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?
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.
Joined: Oct 17, 2006
Yeh you are right, I've changed it to UTF-16 and it solved the problem, 10X!