Mike Dee wrote:
> [snip wrestling with byte strings]

In addition to Martin reply I just want to add two notes:
1. Interactive console in python 2.3 has a bug that was fixed
in 2.4, so you can't enter unicode strings at the prompt:

C:\Python24>python.exe
>>> a=u'ÐÐÐ'
>>> a
u'\u0430\u0431\u0432'

C:\Python23>python.exe
>>> a=u'ÐÐÐ'
>>> a
u'\xa0\xa1\xa2'

in 2.3 you need to use decode method to get unicode strings:
>>> import sys
>>> a2='ÐÐÐ'.decode(sys.stdin.encoding)
>>> a2
u'\u0430\u0431\u0432'

2. Suse ships buggy build of python so title doesn't work
properly, see discussion http://tinyurl.com/4k3au

>>> print aoumlautxyz.title()
ÃÃXyz

You will need to call setlocale to help you:

>>> import locale
>>> locale.setlocale(locale.LC_ALL,'')
'en_US.utf-8'
>>> print aoumlautxyz.title()
ÃÃxyz

  Serge.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to