On Fri, 8 May 2015 07:14 pm, [email protected] wrote:
> Why is array.array('u') deprecated?
>
> Will we get an alternative for a character array or mutable unicode
> string?
Good question.
Of the three main encodings for Unicode, two are variable-width:
* UTF-8 uses 1-4 bytes per character
* UTF-16 uses 2 or 4 bytes per character
while UTF-32 is fixed-width (4 bytes per character). So you could try faking
it with a 32-bit array and filling it with string.encode('utf-32').
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list