[Python-bugs-list] [Bug #115974] utf-16 codec problems with multiple file write

noreply@sourceforge.net noreply@sourceforge.net
Wed, 4 Oct 2000 06:10:55 -0700


Bug #115974, was updated on 2000-Oct-03 20:53
Here is a current snapshot of the bug.

Project: Python
Category: Core
Status: Open
Resolution: None
Bug Group: None
Priority: 7
Summary: utf-16 codec problems with multiple file write

Details: In following example, I would expect to write 14 bytes long file. However, 16 bytes are written, with FF FE inserted in the start of each write. I might be wrong, and this is intentional, however I can not find other way to write/read Unicode file (except as whole, which often is incovenient/impossible).

Vadim

----------------------------------------------------


import codecs

fout = codecs.open("test.utf-16", "wb", 'UTF-16')
fout.write(u"ABC")
fout.write(u"DEF")
fout.close()


For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=115974&group_id=5470