4 ms·
Bad decision? UTF was Standarized in 1993, python was first released in 1991. You can't decide to use something that hasn't been invented yet. Back then bytes a
by fgonzag 8y ago
Bad decision? UTF was Standarized in 1993, python was first released in 1991. You can't decide to use something that hasn't been invented yet. Back then bytes and string were the same thing. Java did do it right but by 1995 the industry had already seen the problems of differing character sets.
- coldtea 8y ago>Back then bytes and string were the same thing. No, they weren't. Impossible as it seems, we had encodings (including multi-byte encodings) for decades before UTF. Python couldn't use UTF-8 in 1991, but it could very well tag strings with a specific encoding, instead of treating them as a bucket of bytes C-style. >Java did do it right but by 1995 the industry had already seen the problems of differing character sets. We had seen the problems of "differing character sets" for decades already (Windows vs DOS version of the same language encodings was a classic example for most users, but the problems go back to EBCDIC and so on). Java just did a more right thing, but we already have a need for generic string types that can handle multiple encodings and know what they contain and how to convert from one to another.