classpathx-javamail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Classpathx-javamail] UnsupportedEncodingException for unicode-1-1-utf-7


From: Boris Folgmann
Subject: [Classpathx-javamail] UnsupportedEncodingException for unicode-1-1-utf-7
Date: Fri, 27 Nov 2009 13:38:22 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.4) Gecko/20091112 SeaMonkey/2.0

Hi,

I get this exception when parsing an email:

java.io.UnsupportedEncodingException: unicode-1-1-utf-7 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 gnu.mail.handler.Text.getContent(Text.java:106) at javax.activationDataSourceDataContentHandler.getContent(DataHandler.java:803) at javax.activation.DataHandler.getContent(DataHandler.java:550) at javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:691) at gnu.mail.providers.imap.IMAPBodyPart.getContent(IMAPBodyPart.java:282)

The encoding might be unsupported by JavaSE 5.0, but as it is a common encoding of emails, as you can read in RFC1642 (UTF-7 - A Mail-Safe Transformation Format of Unicode), I don't see why javamail shouldn't support it.

Is it possible to implement a dirty work-around like forcing the BodyPart's encoding to US-ASCII before calling getContent()? I couldn't find a suitable method.

cu,
        boris





reply via email to

[Prev in Thread] Current Thread [Next in Thread]