length of unicode strings

Trond Eivind Glomsrød teg at redhat.com
Tue Aug 20 19:04:02 EDT 2002


When running on a utf-8 system, python doesn't seem to take it input
in unicode:


Python 2.2.1 (#1, Aug 19 2002, 18:04:04)
[GCC 3.2 (Red Hat Linux Rawhide 3.2-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a="å"
>>> a
'\xc3\xa5'
>>> len(a)
2
>>> b=u"å"
>>> b
u'\xc3\xa5'
>>> len(b)
2
>>> a.isalpha()
0

Any particular things to configure? Enabling the
locale.getdefaultlocale() part in site.py doesn't help :(
-- 
Trond Eivind Glomsrød
Red Hat, Inc.



More information about the Python-list mailing list