Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

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!

java.io.UnsupportedEncodingException: hz-gb-2312

843830Aug 3 2005 — edited Dec 31 2007
Hi

When I use JAVAMail to read an email sent from outlook express with encoding hz-gb-2312 I get the following exception:
java.io.UnsupportedEncodingException: hz-gb-2312
at sun.io.Converters.getConverterClass(Converters.java:218)
at sun.io.Converters.newConverter(Converters.java:251)
at sun.io.ByteToCharConverter.getConverter(ByteToCharConverter.java:68)
at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java:224)
at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java:210)
at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:77)
at java.io.InputStreamReader.<init>(InputStreamReader.java:83)
at com.sun.mail.handlers.text_plain.getContent(text_plain.java:64)
at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.
java:745)
at javax.activation.DataHandler.getContent(DataHandler.java:501)
at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1339)


Here are several headers from the email:
Content-Type: text/plain;
format=flowed;
charset="hz-gb-2312";
reply-type=original
Content-Transfer-Encoding: 7bit


How can I solve this problem?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 28 2008
Added on Aug 3 2005
2 comments
1,142 views