Re: modifying a codec

2008-11-05 Thread Martin v. Löwis
> The codec is doing its job, but I want to override the codepoint for this > character (plus others) to use the html entity instead (from \227 to > — in this case). > > I see hints writing your own codec and updating the decoding_map, but I > could use some more detail. > > Is that the best

modifying a codec

2008-11-05 Thread Tim Arnold
Hi, I'm using the codecs module to read in utf8 and write out cp1252 encodings. For some characters I'd like to override the default behavior. For example, the mdash character comes out as the code point \227 and I'd like to translate it as — instead. Example: the file myutf8.txt contains this s