[Tutor] Composing codecs using codecs.EncodedFile / UTF-16 DOS format converted to Unix ASCII

Poor Yorick gp@pooryorick.com
Tue Jan 7 21:22:34 2003


Danny Yoo wrote:

>
>Ah, I see what you mean now.  No, as far as I understand, Python doesn't
>do this automatic conversion of newlines.  However, Python 2.3's
>"Universal Newline" support is probably what you're looking for.
>

Thanks for the sample code!  It'll take me a while to digest....

But about newlines, I thought that '\n' was already a sort of universal 
newline for Python.  On windows platforms, both open.read and 
open.readlines already transform '\r\n' into '\n' unless you use binary 
mode.  That's why I thought it was a discrepancy for codecs.open to 
return '\r\n'.

Poor Yorick
gp@pooryorick.com