Trouble importing / using a custom text codec
Martin von Loewis
loewis at informatik.hu-berlin.de
Thu Feb 28 10:17:06 EST 2002
More information about the Python-list mailing list
Thu Feb 28 10:17:06 EST 2002
- Previous message (by thread): Trouble importing / using a custom text codec
- Next message (by thread): problems with photoimage and tkinter
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
jhorneman at pobox.com (Jurie Horneman) writes: > - With cp932.py in site-packages as described above, if I decode a > text using encoding "MBCS_codecs.cp932", I get the error message > "LookupError: unknown encoding". This happens even if I import cp932 > by hand before decoding the text. I recommend a different strategy. Aim for allowing "cp932" as an encoding name. To achieve this, put the following (or something like this) into MBCS_codecs/__init__.py def search_mbcs(encoding): if encoding == "cp932": import cp932 return cp932.getregentry() return None codecs.register(search_mbcs) If you want this to happen at startup time of Python, just add a MBCS_codecs.pth file in site-packages, which reads import MBCS_codecs HTH, Martin
- Previous message (by thread): Trouble importing / using a custom text codec
- Next message (by thread): problems with photoimage and tkinter
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list