We help IT Professionals succeed at work.

How to transfer Big5 code to Unicode

edwardlan
edwardlan asked
on
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..

Comment
Watch Question

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
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
Just mention the encoding scheme to use when you read the data. All Java strings are Unicode strings.
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
Just mention the encoding scheme to use when you read the data. All Java strings are Unicode strings.
Commented:
use of you jdk bin folder's native2ascii.exe utility..

for example:

c:\jdk1.3\bin\native~1 -encoding MS936 c:\a.txt c:\b.properties

Where
MS936 is for Simplified Chinese Charectors;
c:\a.txt is original big5 source file;
c:\b.properties is target files.


Author

Commented:
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.

Commented:
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)

Author

Commented:
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.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.