3 ms·
The easy and sane path would have been to just mandate that str is encoded as UTF-8. (Indeed, that's what every other sane language seems to do.) Instead they
by otabdeveloper4 6y ago
The easy and sane path would have been to just mandate that str is encoded as UTF-8. (Indeed, that's what every other sane language seems to do.)
Instead they tried to split every function into a 'wide' (str) and a 'narrow' (bytes) version, like in Windows.
The whole idea of 'wide' strings is predicated on the idea that Unicode charpoints are only ever two bytes and that two bytes is all you ever need.
This obviously doesn't work in 2020, and the Python folks tried to roll back their broken by design code that has immediately turned into technical debt right out the gate, but the warts still exist. (Like having to choose whether you open files with 'w' or 'wb', etc. No other language does this stupid thing, I think.)