News for hackers. Stuff that matters.
Re:Memory use in CPython and MicroPython by svennek on Sunday July 02, 2017 @05:23AM (#14681658)
Yes, I have (for more than a decade in four different languages, not all of those who are latin1)... One project was even both LTR and RTL :)

Byte handling is definately not fun in variable encodings, and even fixed-length multi-byte encodings require a lot of support functionality when working with bytes..

Such a simple thing as "len" is suddenly hard (for the human definition of length and not the byte-length), the latter is also easily attainable by converting the string to bytes and get the length of that in the given encoding.

Re:Memory use in CPython and MicroPython by patrec on Sunday July 02, 2017 @07:42PM (#14684898)
len isn't a great example because it doesn't do anything remotely useful on python3 strs in the general case. In particular it doesn't tell you how many characters the str has, which is what you probably wanted to know -- possibly as an approximation for figuring out how many columns in fixed-width it would take, in which case of course you are even more likely to be disappointed.

In python2 len(str) will tell you exactly how many bytes some text takes, which is useful.