Re: universal newlines and utf-16

2010-04-11 Thread Antoine Pitrou
Le Sun, 11 Apr 2010 16:16:45 +0100, Baz Walter a écrit : > On 11/04/10 15:37, Stefan Behnel wrote: >> The codecs module does not support universal newline parsing (see the >> docs). You need to use the new io module instead. > > thanks. > > i'd completely overlooked the io module - i thought it w

Re: universal newlines and utf-16

2010-04-11 Thread Baz Walter
On 11/04/10 15:37, Stefan Behnel wrote: The codecs module does not support universal newline parsing (see the docs). You need to use the new io module instead. thanks. i'd completely overlooked the io module - i thought it was only in python 2.7/3.x. -- http://mail.python.org/mailman/listin

Re: universal newlines and utf-16

2010-04-11 Thread Stefan Behnel
Baz Walter, 11.04.2010 16:12: i am using python 2.6 on a linux box and i have some utf-16 encoded files with crlf line-endings which i would like to open with universal newlines. so far, i have been unable to get this to work correctly. for example: >>> open('test.txt', 'w').write(u'a\r\nb\r\

universal newlines and utf-16

2010-04-11 Thread Baz Walter
i am using python 2.6 on a linux box and i have some utf-16 encoded files with crlf line-endings which i would like to open with universal newlines. so far, i have been unable to get this to work correctly. for example: >>> open('test.txt', 'w').write(u'a\r\nb\r\n'.encode('utf-16')) >>> repr(