Message79330
Well, there are other problems with utf-16, e.g. when opening an
existing file for appending, the BOM is written again:
>>> f = open('utf16.txt', 'w', encoding='utf-16')
>>> f.write('abc')
3
>>> f.close()
>>> f = open('utf16.txt', 'a', encoding='utf-16')
>>> f.write('def')
3
>>> f.close()
>>> open('utf16.txt', 'r', encoding='utf-16').read()
'abc\ufeffdef'
Who said TextIOWrapper was sane? :-o |
|
| Date |
User |
Action |
Args |
| 2009-01-07 12:59:01 | pitrou | set | recipients:
+ pitrou, amaury.forgeotdarc, vstinner |
| 2009-01-07 12:59:01 | pitrou | set | messageid: <[email protected]> |
| 2009-01-07 12:59:00 | pitrou | link | issue4862 messages |
| 2009-01-07 12:59:00 | pitrou | create | |
|