brendonh / pyth

Python text markup and conversion
MIT License
89 stars 79 forks source link

fix handle_ansi_escape #11

Closed dorosh closed 9 years ago

dorosh commented 12 years ago

chr(129) '\x81' char = '\x81'.decode('cp932') Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'cp932' codec can't decode byte 0x81 in position 0: incomplete multibyte sequence

I made a temporary solution for def handle_ansi_escape(self, code): in rtf15.reader.py

yairchu commented 9 years ago

I believe that using "incrementaldecoder" is probably the cleanest way. btw see https://github.com/brendonh/pyth/issues/15

brendonh commented 9 years ago

Fixed in 381a3067add074fb5cf48fbc5e56f5b7ba28d795 and I've included your test file in the (new!) RTF tests.