Link to home
Start Free TrialLog in
Avatar of edwardlan
edwardlan

asked on

How to transfer Big5 code to Unicode

Hi, everyone:
  Is there any algorithm, tool or API can help me transfer Big5 code to Unicode in an application, and how? Is it possible to write a function to do this?
Thank you..

Avatar of sdussinger
sdussinger

Check out the tutorial on the Sun Java site.

http://java.sun.com/docs/books/tutorial/i18n/text/stream.html

It contains a mechanism for converting non-unicode bytes streams into Unicode strings and vice versa.

HTH

--Steve
Avatar of Mick Barry
Just mention the encoding scheme to use when you read the data. All Java strings are Unicode strings.
Just mention the encoding scheme to use when you read the data. All Java strings are Unicode strings.
ASKER CERTIFIED SOLUTION
Avatar of alen_ycc
alen_ycc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of edwardlan

ASKER

But since I am developing the application on the terminals(you know, not as powerful as PCs), I may not upgrade the compiler inside them. So what I need is when the terminal receive the message which is encoded in BIG5, how could I translated them into Unicode? Is there any algorithm to do so? Sorry for not making myself perfectly understood! And really appreciate your help, thanks.
after you have encoded your big5 properties file into the unicode format, you can use of "resource bundle" with hashtable to read  your unicode properties file
like:

resourceBundel.getString("label_code");

where,
label_code is  the key in your hashtable,

provided the properties file having:

label_code=\u5432 \u3432 (unicode)

But whenever I try to decode BIG5, it just give me an exception saying "UnsupportedEncodingException". I believe it's the version of the JDK, but I just can't upgrade the terminals. That's why I need some other way to solve the problem. Anyway, thanks for your advice.