users@glassfish.java.net

Re: JavaMail QPEncoderStream =0D and =0A bug (not newlines)

From: <glassfish_at_javadesktop.org>
Date: Wed, 07 Jan 2009 13:59:35 PST

It looks like you're trying to preserve a standalone CR in text that
uses CRLF or LF to terminate lines, is that correct?

In general, Java accepts CR, LF, or CRLF as a line terminator.

It would be possible for the encoder to enforce that all except the
platform-specific line terminator is encoded, but that would likely
cause a lot of unnecessary encoding when (e.g.) a Windows text
file is sent from a Unix server. I suppose it would be possible to
add an option to enable that behavior, but such a change is more
complex than your simplistic fix.

If you absolutely need to ensure that these characters are preserved
in text data, you'll need to check for these cases and force base64
encoding.

(BTW, JavaMail questions will get more attention in the JavaMail forum:
http://forums.sun.com/forum.jspa?forumID=43.)
[Message sent by forum member 'shannon' (shannon)]

http://forums.java.net/jive/thread.jspa?messageID=324636