java.io.UnsupportedEncodingException: hz-gb-2312
843830Aug 3 2005 — edited Dec 31 2007Hi
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?