On Tue, Oct 21, 2008 at 9:52 AM, Tim Brown <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to create and append unicode strings to a utf-16 text file. > The best I could come up with was to use codecs.open() with an > encoding of 'utf-16' but when I do an append I get another UTF16 BOM > put into the file which other programs do not expect to see :-( > Is there some way to stop codecs from doing this or is there a better > way to create and add data to a utf-16 text file?
IIRC the UTF-16BE and UTF-16LE codecs don't use BOMs. You could also convert the unicode strings to str yourself and open the file as plain text. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor