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")
utf8_sig = codecs.lookup("utf-8-sig")
return codecs.CodecInfo(
name='myutf8',
encode=utf8.encode,
decode=utf8_sig.decode,
incrementalencoder=utf8.IncrementalEncoder,
incrementaldecoder=utf8_sig.IncrementalDecoder,
streamreader=utf8_sig.StreamReader,
streamwriter=utf8.StreamWriter,
)
codecs.register(search_function)
Closing the issue as "wont fix"
----------
resolution: -> wont fix
status: open -> closed
__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1328>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com