[issue1276] LookupError: unknown encoding: X-MAC-JAPANESE

Hye-Shik Chang report at bugs.python.org
Thu Jun 26 14:06:09 CEST 2008


Hye-Shik Chang <hyeshik at gmail.com> added the comment:

Added a patch that implements codecs for CJK Macintosh encodings.
I tried to implement that just alike the other existing CJK codecs,
but it required many inefficient mapping tables due to their odd
mappings (like this: u'ABCDE' <-> 'ab' AND u'ABCD' <-> 'ac'!).

So, I decided to implement a general extension codec wrapper that
can be easily modified by dictionaries given by Python code.
Because all Mac CJK encodings have codecs that implement their base
encodings, I just put their difference in Python codec code.
The extension mechanism may be reused in customized codecs for
in-house applications or legacy encoding supports.

The first patch was generated for 2.6 trunk.  I'm working on porting
it to 3.0.

Added file: http://bugs.python.org/file10743/maccjkcodecs-1.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1276>
_______________________________________


More information about the Python-bugs-list mailing list