Bug with win32 open and utf-16 file

derek / nul abuseonly at sgrail.org
Sat Aug 23 20:29:27 EDT 2003


On Sat, 23 Aug 2003 17:46:33 +0300, Christos "TZOTZIOY" Georgiou
<tzot at sil-tec.gr> wrote:

>On Sat, 23 Aug 2003 14:36:58 GMT, rumours say that derek / nul
><abuseonly at sgrail.org> might have written:
>
>[snip opening 'rb' a UTF-16 file]
>
>>The original file has line terminator characters of 00 0d 00 0a.
>>After being read into a variable or a list the line termination characters have
>>been changed to 00 0a 00 0a
>
>You didn't mention any writing back the file.  Do you?  How exactly do
>you write it back?

I haven't got to that yet, I suspect the file when written will have twice as
many line feeds as the original file which will be a problem.

>By the way, what are the unicode name for the characters u"\u000a" and
>u"\u000d"?  In ASCII (stripping the MSB), they are LF and CR.

I don't know about the unicode names, I am concerned about their ascii
equivalent.

Derek




More information about the Python-list mailing list