Walter Dörwald [EMAIL PROTECTED] added the comment:
If you want to use UTF-8-sig for decoding and UTF-8 for encoding and
have this available as one codec you can define your owen codec for this:
import codecs
def search_function(name):
if name == myutf8:
utf8 = codecs.lookup(utf-8)
Walter Dörwald [EMAIL PROTECTED] added the comment:
Oops, that code was supposed to read:
import codecs
def search_function(name):
if name == myutf8:
utf8 = codecs.lookup(utf-8)
utf8_sig = codecs.lookup(utf-8-sig)
return codecs.CodecInfo(
name='myutf8',
Walter Dörwald [EMAIL PROTECTED] added the comment:
I don't see exactly what James is proposing.
For my needs, I would like the decoding parts of the utf_8 module
to treat an initial BOM as an optional signature and skip it if
there is one (just like the utf_8_sig decoder). In fact I have
a
James G. sack (jim) [EMAIL PROTECTED] added the comment:
Can you post an example that requires this code?
This is not a big issue, and it wouldn't hurt if it got declared go away
and come back later if you have patch, test, docs, and a convincing use
case.
..But, for the record..
Suppose
Sean Reifschneider [EMAIL PROTECTED] added the comment:
It sounds like the Unicode FAQ has an authoritative statement on this,
is this a wontfix, or does this need more discussion? Perhaps on
python-dev or at the sprints this week?
--
assignee: - doerwalter
nosy: +jafo
priority: -