UTF-8 Everywhere (2012)
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.<p>You rarely need to index a string with an integer in Python.  FOR loops don&#x27;t need to.  Regular expressions don&#x27;t need to.  Operations that return a position into the string could return an opaque type which acts as a string index.  That type should support adding and subtracting integers (at least +1 and -1) by progressing through the string.  That would take care of most of the use cases. Attempts to index a string with an int would generate index arrays internally. (Or, for short strings, just start at the beginning every time and count.)<p>Windows and Java have big problems. They really are 16-bit char based. It&#x27;s not Java&#x27;s fault; they standardized when Unicode was 16 bits.