Stefano Bagnara wrote: > Are you sure the problem is that charsetName is null? > Isn't instead this method called with "anychar" ? > > Wouldn't it be better to catch UnsupportedCharsetException and > IllegalCharsetNameException around Charset.forName and simply leave c > as null so that the following if will simply use the already present > default? > > And, at the moment, I would leave the TODO there, because maybe > ISO8859-1 is not the best default for everyone. > > I thought about using: > new InputStreamReader(new ByteArrayInputStream(new byte[0]).getEncoding() > But this would return UTF8 on system having a default file encoding > set to UTF8 and maybe it is not good to parse email as UTF8 when > unspecified. > > Any hint? > > Stefano
CharsetUtil.getCharset() is only used when writing a Message using Message.writeTo(). When parsing to a Message object the default is to use ISO8859-1 if the charset specified in the message is unknown or not specified. -- Niklas Therning www.spamdrain.net --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]