Uppercase/Lowercase on unicode

Ben Finney ben+python at benfinney.id.au
Fri Jun 5 05:54:25 EDT 2009


Kless <jonas.esp at googlemail.com> writes:

> Is there any librery that works ok with unicode at converting to
> uppercase or lowercase?
> 
> --------------
> >>> foo = u'áèïöúñ'
> 
> >>> print(foo.upper())
> áèïöúñ
> --------------

Works fine for me. What do you get when trying to replicate this:

    >>> import sys
    >>> sys.version
    '2.5.4 (r254:67916, Feb 18 2009, 04:30:07) \n[GCC 4.3.3]'
    >>> sys.stdout.encoding
    'UTF-8'
    >>> foo = u'áèïöúñ'
    >>> print(foo.upper())
    ÁÈÏÖÚÑ

-- 
 \     “I was sad because I had no shoes, until I met a man who had no |
  `\       feet. So I said, ‘Got any shoes you're not using?’” —Steven |
_o__)                                                           Wright |
Ben Finney



More information about the Python-list mailing list