Unicode charmap decoders slow

Tony Nelson *firstname*nlsnews at georgea*lastname*.com
Mon Oct 3 12:40:43 EDT 2005


In article <43410f1b$0$7019$9b622d9e at news.freenet.de>,
 "Martin v. Löwis" <martin at v.loewis.de> wrote:

> Tony Nelson wrote:
> > Is there a faster way to decode from charmaps to utf-8 than unicode()?
> 
> You could try the iconv codec, if your system supports iconv:
> 
> http://cvs.sourceforge.net/viewcvs.py/python-codecs/practicecodecs/iconv/

I had seen iconv.  Even if my system supports it and it is faster than 
Python's charmap decoder, it might not be available on other systems.  
Requiring something unusual in order to do a trivial LUT task isn't an 
acceptable solution.  If I write a charmap decoder as an extension 
module in Pyrex I can include it with the program.  I would prefer a 
solution that doesn't even need that, preferably in pure Python.  Since 
Python does all the hard wark so fast it certainly could do it, and it 
can almost do it with "".translate().
________________________________________________________________________
TonyN.:'                        *firstname*nlsnews at georgea*lastname*.com
      '                                  <http://www.georgeanelson.com/>



More information about the Python-list mailing list