This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author doerwalter
Recipients Rhamphoryncus, doerwalter, ggenellina, jafo, jgsack
Date 2008-03-22.14:42:00
SpamBayes Score 0.5054639
Marked as misclassified No
Message-id <1206196922.38.0.525541881254.issue1328@psf.upfronthosting.co.za>
In-reply-to
Content
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"
History
Date User Action Args
2008-03-22 14:42:02doerwaltersetspambayes_score: 0.505464 -> 0.5054639
recipients: + doerwalter, jafo, jgsack, ggenellina, Rhamphoryncus
2008-03-22 14:42:02doerwaltersetspambayes_score: 0.505464 -> 0.505464
messageid: <1206196922.38.0.525541881254.issue1328@psf.upfronthosting.co.za>
2008-03-22 14:42:01doerwalterlinkissue1328 messages
2008-03-22 14:42:00doerwaltercreate