Message172529
> with codecs.open('test.txt', 'wb', 'utf-16-le') as fp:
Since Python 2.6+, you can use io.open() which uses the new io library. The io library uses TextIOWrapper which uses incremental encoder and decoder and so handles multibyte encodings correctly (as UTF-16).
Said differently, this issue is already fixed in the io library.
It remembers me that I should propose again my PEP 400 :-) |
|
Date |
User |
Action |
Args |
2012-10-09 21:17:31 | vstinner | set | recipients:
+ vstinner, ezio.melotti, serhiy.storchaka, lovelylain, Marcus.Gröber |
2012-10-09 21:17:31 | vstinner | set | messageid: <1349817451.5.0.448433583768.issue15278@psf.upfronthosting.co.za> |
2012-10-09 21:17:31 | vstinner | link | issue15278 messages |
2012-10-09 21:17:31 | vstinner | create | |
|