File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes How to add a new charset? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to add a new charset?" Watch "How to add a new charset?" New topic

How to add a new charset?

James Lee
Ranch Hand

Joined: Oct 16, 2006
Posts: 36
Hi everyone,

How can I add Shift_JIS encoding to my java environment so that I can use a string of Japanese chars (e.g., ソqソセ ?

The doc in java.nio.charset.Charset class mentions
Support for new charsets can be added via the service-provider interface defined in the CharsetProvider class.
but I can't figure out how.

austine hsieh

Joined: Nov 07, 2011
Posts: 2
this problem was resolved?
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

It wasn't a problem, actually.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46349
But welcome to the Ranch austine hsieh
austine hsieh

Joined: Nov 07, 2011
Posts: 2
in fact,i have a problem in a task,my Company is in Taiwan and our charset was Big5,i get '?' in java program when i receive a file .
but the original file was corrected when i open it by ultraedit or other editor,finally, Someone told me '?' was user defined area in Big5,
So i start google how to fix this problem ,i find "charsets.jar" in jre/lib folder,it's define how to convert character from Big5 to Unicode ,
then i have two idea to fix it and i don't change any code in my program.
one, i fix the mapping class in charsets.jar and repackage it,but i think it's not good idea
two, i use CharsetProvider class replace it,but i have no idea how to start it.
Anyone can help me?
I agree. Here's the link:
subject: How to add a new charset?
It's not a secret anymore!