james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Therning <nik...@trillian.se>
Subject Re: svn commit: r531444 - /james/mime4j/trunk/src/main/java/org/mime4j/util/CharsetUtil.java
Date Mon, 23 Apr 2007 12:43:08 GMT
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: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message