EuGeNe Van den Bulke <[EMAIL PROTECTED]> wrote: > Duncan Booth wrote: >> However, the decoded text looks as though it is utf16 encoded so it >> should be written as binary. i.e. the output mode should be "wb". > > Thanks for the "wb" tip that works (see bellow). I guess it is > experience based but how could you tell that it was utf16 encoded?
I pasted the encoded form into idle and decoded it base 64. It ends with \r \x00\n\x00 and the nulls instantly suggest a 16 bit encoding. Scrolling to the beginning and it starts \xff\xfe which is the BOM for little-endian utf16. -- http://mail.python.org/mailman/listinfo/python-list