Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #54698

Re: removing BOM prepended by codecs?

From Dave Angel <davea@davea.name>
Subject Re: removing BOM prepended by codecs?
Date 2013-09-24 13:35 +0000
References <52418D10.9080508@kent.ac.uk>
Newsgroups comp.lang.python
Message-ID <mailman.296.1380029767.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 24/9/2013 09:01, J. Bagg wrote:

Why would you start a new thread?  just do a Reply-List (or Reply-All
and remove the extra names) to the appropriate message on the existing
thread.

> I'm using:
>
> outputfile = codecs.open (fn, 'w+', 'utf-8', errors='strict')

That won't be adding a BOM.  It appends to an existing file, which
already may have a BOM in it.  Or conceivably you have a BOM in your
unicode string that you're passing to write() method.

>
> to write as I know that the files are unicode compliant. I run the raw 
> files that are delivered through a Python script to check the unicode 
> and report problem characters which are then edited. The files use a 
> whole variety of languages from Sanskrit to Cyrillic and more obscure 
> ones too.
>
it'd be much nicere to remove it when writing the file.
-- 
DaveA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: removing BOM prepended by codecs? Dave Angel <davea@davea.name> - 2013-09-24 13:35 +0000

csiph-web