Binary strings, unicode and encodings

Serge Orlov sombDELETE at pobox.ru
Sat Jan 17 04:10:24 EST 2004


"Laurent Therond" <google at axiomatize.com> wrote in message news:265368cb.0401161604.58099d89 at posting.google.com...
> Peter, thank you for taking the time to answer.
>
> I will need some time to digest this information.
>
> From where I stand, a Python newbie who knows more about Java, this
> concept of binary string is puzzling. I wish Python dealt in Unicode
> natively, as Java does. It makes things a lot easier to comprehend

Python does deal with Unicode natively. You just need to put u
character before the string. This of course a violation of the rule
"There should be one-- and preferably only one --obvious way to do it."
'a' == u'a'. But remember that Python appeared before Unicode,
so strings in Python could not be unicode strings from the beginning
.
> Having strings be byte arrays, on the other, seems to confuse me.

Use unicode strings only.

-- Serge.





More information about the Python-list mailing list