[Csv] Switch to universal mode?

Skip Montanaro skip at pobox.com
Wed Jun 16 17:51:56 CEST 2004


    Andrew> I'm not convinced this is necessary or desirable - what will the
    Andrew> universal newline code do to a CR or LF embedded in a quoted
    Andrew> field (it's important to preserve these verbatim)? The resulting
    Andrew> simplifications to the parser are relatively minor, I think.

You're right.  Universal newline mode would hose those characters in
different ways on different platforms.  That makes binary mode required.

I still think we should enforce what we need in our code instead of relying
on users to get it right.  Most of the problems I've seen people have go
away when they open the files properly.  Opening files with just "r" or "w"
works properly most of the time, but on occasion doesn't (when the file
winds up containing embedded CR or LF characters).

Skip


More information about the Csv mailing list