Maarten Derickx <maarten.deri...@navara.nl> added the comment:

The route via gencodec or more generally via charmap_encode and charmap_decode 
seems to be one that is not possible without some low level CPython code 
adjustments. The reason for this is that charmap_encode and charmap_decode only 
seem to support mappings where a single encoded byte corresponds to multiple 
unicode points.

However iso6937 is a mixed length encoding, meaning in this specific case that 
unicode characters sometimes need to be encoded as a single byte and sometimes 
with two bytes.

For example chr(0x00c0) should be encoded as b'\xc1' + b'A'.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue24339>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to