3 ms·
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
by svennek 9y ago
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.
- patrec 9y agolen 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.