This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Character encoding problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Character encoding problem" Watch "Character encoding problem" New topic
Author

Character encoding problem

Dominic Steng�rd
Ranch Hand

Joined: Feb 05, 2001
Posts: 186
Hey JavaGurus!

What I need is a converter between Unicode characters and Big5 characters. Big5 is a stand-alone character set encoding; used in China, Hong Kong and Taiwan.

Input should be a Unicode character (0x4e00) and output should be the equivalent character but encoded in Big5 (0xA440).

I thought this code would do this is:



But the output is still in Unicode ... not Big5?
Need your help. :-)
Thanks!


Dominic Steng�rd<br />Sun Certified Java 2 Programmer
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

All Strings in Java are Unicode, there is nothing you can do to change that. However, when you output the String you can will use a character set other than Unicode if for example the file uses big5 encoding. Have a look at the contructors of jav.io.OutputStreamWriter.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Character encoding problem
 
Similar Threads
Problem encoding japanese character
Displaying Foreign Languages
How to find number of chinese characters?
Need help with Charset class issue ... :-)
Unicode conversion