News for hackers. Stuff that matters.
Re:UTF-8 Everywhere (2012) by the_mitsuhiko on Sunday June 19, 2016 @05:53PM (#11934879)
> The Python problem is amusing. Python 3 has three representations of strings internally (1-byte, 2-byte, and 4-byte) and promotes them to a wider form when necessary. This is mostly to support string indexing. It probably would have been better to use UTF-8, and create an index array for the string when necessary.

It's especially amusing because on Python 3 strings internally cache their utf-8 equivalent if it was used once.

Re:UTF-8 Everywhere (2012) by Animats on Sunday June 19, 2016 @08:40PM (#11935481)
I didn't know that. That's funny. They really are doing this the hard way.
Re:UTF-8 Everywhere (2012) by int_19h on Monday June 20, 2016 @01:04AM (#11936151)
It really is the hard way. For the curious, read through the comment here describing the data layout and invariants:

https://github.com/python/cpython/blob/master/Include/unicod...