james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florent Georges <li...@fgeorges.org>
Subject Re: Shouldn't Reader convert \r\n to \n?
Date Mon, 28 Dec 2009 11:23:55 GMT
Stefano Bagnara wrote:


> >  I am using a MimeTokenStream to parse a multipart message.
> > For bodies with textual content (for instance text/plain), I
> > get a Reader object from MimeTokenStream.getReader().
> > Unfortunately, it seems to not convert \r\n (correct end of
> > line in messages on the wire) to \n (correct end of line in
> > Java strings).

> Why do you think \n is the correct end of line in Java
> strings ?  This is platform dependant and there is no such
> thing as the "correct end of line in java strings".

  Mmh...  It seems you are right.  I've always thought that one
of the differences between byte and character streams was the
en-/de-coding of the platform dependent end of line to the
canonical form '\n'.  It seems I was wrong, and ends of line
seems to be never decoded by a Reader (except by BufferedReader
but that's not really the same thing).

  I guess this is a legacy of my C and C++ experiences :-/

> Hope you got it,

  Yup.  I've even learned something today :-)  Thanks for the
explanation, and sorry for the noise, regards,

Florent Georges


View raw message