A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2010-January/097177.html below:

[Python-Dev] Improve open() to support reading file starting with an unicode BOM

[Python-Dev] Improve open() to support reading file starting with an unicode BOMLennart Regebro regebro at gmail.com
Sun Jan 10 12:21:48 CET 2010
On Sun, Jan 10, 2010 at 12:10, Henning von Bargen
<henning.vonbargen at arcor.de> wrote:
> If Python should support BOM when reading text files,
> it should also be able to *write* such files.

That's what I thought too. Turns out the UTF-16 does write such a
mark. You also have the constants in the codecs module, so you can
write the utf-16-le BOM and then use the utf-16-le encoding if you
want to be sure you write utf-16-le, and the same with BE, of course.

I still think now using BOM's when determining the file format can be
seen as a bug, though, so I don't think the API needs to change at
all.
-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4