Author inada.naoki
Recipients inada.naoki, libcthorne, martin.panter
Date 2018-06-05.08:20:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1528186837.02.0.592728768989.issue33578@psf.upfronthosting.co.za>
In-reply-to
Content
ISO-2022-* is "stateful" encoding.  It uses escape sequence to change state.
So keeping only `pending` is not enough.

>>> enc.encode("abcあいう")
b'abc\x1b$B$"$$$&'
>>> enc.getstate()
0
>>> enc.encode("abc")
b'\x1b(Babc'

>>> enc.encode("abcあいう")
b'abc\x1b$B$"$$$&'
>>> enc.getstate()
0
>>> enc.setstate(0)
>>> enc.encode("abc")
b'abc'

I don't know much about other encodings.
History
Date User Action Args
2018-06-05 08:20:37inada.naokisetrecipients: + inada.naoki, martin.panter, libcthorne
2018-06-05 08:20:37inada.naokisetmessageid: <1528186837.02.0.592728768989.issue33578@psf.upfronthosting.co.za>
2018-06-05 08:20:37inada.naokilinkissue33578 messages
2018-06-05 08:20:36inada.naokicreate