4 ms·
With a little bit more work, you could have something you could pass to codecs.register()¹, so that you could encode and decode in the standard way: text =
by thristian 11y ago
With a little bit more work, you could have something you could pass to codecs.register()¹, so that you could encode and decode in the standard way:
text = u'ႹЄLᒪo, ǃ'
enc = text.encode('utf-9')
dec = enc.decode('utf-9')
assert text == dec
¹: https://docs.python.org/2.7/library/codecs.html#codecs.register https://docs.python.org/2.7/library/codecs.html#codecs.regis...
- thristian 11y agoApparently HN eats emoji. Ah, well.
- enricobacis 11y agoNice idea, I will try to implement it ;) I will probably have to pay attention to the final call for the IncrementalEncoder. In fact I let bitarray to add 0's at the end of the encoded data to comply with these pesky 8 bit architecture ;)