Boost logo

Boost Users :

From: Andrew Holden (aholden_at_[hidden])
Date: 2008-04-03 14:03:45


Soren Soe [soren.soe_at_[hidden]] wrote:
> It appears boost::iostreams::newline_filter(posix) converts
> all CRs into LFs rather than just converting the sequence
> CRLF. In other words: "\rtext\r\r\n"
> is converted to "\ntext\n\n" when I would have expected
> "\rtext\r\n". Indeed the latter is what dos2unix does on my
> linux system. Is this a bug in the newline_filter?

I just had a chance to look at newline_filter myself. I looks to me
like it also converts from Mac-format text files (carriage return only)
to Unix. It auto-detects the input format and allows mixed-format input
streams.

In your example ("\rtext\r\r\n"), it interprets the text as
"<mac_newline>text<mac_newline><dos_newline>".

Perhaps there is some value in a flag that only converts certain
newlines to the target type?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net