• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Character encoding problem

 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!