unicode revisted

Alex Martelli aleaxit at yahoo.com
Tue Nov 14 15:32:22 EST 2000


"June Kim" <junaftnoon at nospamplzyahoo.com> wrote in message
news:8urf0t$snj$1 at news.nuri.net...
> I posted something similar to this a few weeks ago but
> got no response from anyone. Maybe we have very few
> people interested in the internationalization.

Or at least few people who are both interested in i18n (as
an Italian working in English for a US company largely owned
by Italians and selling in Japan, Korea, US, and Europe, I'd
say I qualify...) AND who think they really grasp the new
Unicode stuff of Python 2...?


> Supposing sys.getdefaultencoding() == 'whatever'
> What is u'abracadabra' == unicode('abracadabra') ==
> unicode('abracadabra','whatever') ?
>
> Aren't they supposed to be the same semantically, and effectively?

I'm not sure what encoding the u'blah' form uses.  Does
the Python parser really "call out" to whatever has been
set (in siteconfigure, I guess) as the defaultencoding...?

I think the equivalence will hold between
    unicode(whatever)
and
    unicode(whatever, sys.getdefaultencoding())
though...


Alex






More information about the Python-list mailing list