Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Converting UTF-8 to UCS-2

807603Oct 31 2007 — edited Nov 1 2007
Hi All, I really need some help with character encoding. So here's my problem.

I have a properties file (message.properties) which is saved in UTF-8 format and contains Chinese Characters. I read this String using this code:

String value = new String(bundle.getString(key).getBytes(getValue(Constants."ISO-8859-1")), getValue("UTF-8"));

And it's working properly, I can retrieve the Chinese Character and insert it to database. The problem is now, this Chinese Character is going to be sent to a mobile phone via sms, which can only accept character in UCS-2.

I have been having trouble in converting this UTF-8 Chinese Character to UCS-2. Can somebody help me? Refer me to any links that might help??

I'm desperate :(

Thanks before...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 29 2007
Added on Oct 31 2007
1 comment
461 views