Recent versions only convert to UTF-32 when a wide character is present (they also use 2 byte characters when that is sufficient):<p><a href="https:&#x2F;&#x2F;docs.python.org&#x2F;3.3&#x2F;whatsnew&#x2F;3.3.html#pep-393-flexible-string-representation" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;3.3&#x2F;whatsnew&#x2F;3.3.html#pep-393-flexib...</a><p>Glancing at Julia, I&#x27;m not sure &quot;invalid character index&quot; is really a great thing to have to handle when dealing with text. It does seem that systems for dealing with text will eventually offer various apis beyond just a somewhat disfunctional character api (which I think is a fair description of str in Python 3).