python for everyday tasks
wxjmfauth at gmail.com
wxjmfauth at gmail.com
Mon Nov 25 05:12:57 EST 2013
Le samedi 23 novembre 2013 03:01:26 UTC+1, Steven D'Aprano a écrit :
>
>
>
> * Python 3 (although not Python 2) is one of the few languages that get
>
> Unicode *right*. Strings in Python 3 are text, sequences of Unicode
>
> characters, not a thinly disguised blob of bytes. Starting with Python
>
> 3.3, Python does away with the difference between "narrow builds" (which
>
> save memory at the expense of correctness) and "wide builds" (which give
>
> correct Unicode behaviour at the cost of memory). Instead, Python 3.3 now
>
> has optimized strings that use only as much memory as needed. Pure ASCII
>
> strings will use 1 byte per character, while Unicode strings use 1, 2 or
>
> 4 bytes per character as needed. And it all happens transparently.
>
>
----------
[topic beeing more of less closed]
Your paragraph is mixing different concepts.
When it comes to save memory, utf-8 is the choice. It
beats largely the FSR on the side of memory and on
the side of performances.
How and why? I suggest, you have a deeper understanding
of unicode.
May I recall, it is one of the coding scheme endorsed
by "Unicode.org" and it is intensively used. This is not
by chance.
jmf
More information about the Python-list
mailing list