Comment Re:I don't currently use Rust (Score 1) 139
The way a language runtime stores unicode strings in memory is a different thing from the way the language interacts with byte data in the world. Python's approach is to treat unicode strings as essentially arrays of unicode code points. Slicing is all done based on the array position of the unicode code points. The way they are stored in memory is irrelevant to the programmer and abstracted away, except that the programmer still has to be aware of unicode's many warts such as pairs..
Under the hood Python stores them in memory as UCS-32, UCS-16, or ASCII depending on the string's contents. None of that matters. What does matter is that when you want to send unicode to the world, you encode it to bytes using whatever scheme you require. The default if not specified is UTF-8. While reading data in, you must decode the data, telling the
Python strings are also immutable, so they are fundamentally different than the way other languages handle strings.