Uppercase/Lowercase on unicode

K

Kless

Is there any librery that works ok with unicode at converting to
uppercase or lowercase?

--------------áèïöúñ
--------------
 
G

Gabriel Genellina

Is there any librery that works ok with unicode at converting to
uppercase or lowercase?

Looks like Python thinks your terminal uses utf-8, but it actually uses
another encoding (latin1?)
Or, you saved the script as an utf-8 file but the encoding declaration
says otherwise.

This works fine for me:

py> foo = u'áèïöúñ'
py> print foo
áèïöúñ
py> print foo.upper()
ÁÈÏÖÚÑ
 
K

Kless

Looks like Python thinks your terminal uses utf-8, but it actually uses  
another encoding (latin1?)
Or, you saved the script as an utf-8 file but the encoding declaration  
says otherwise.

This works fine for me:

py> foo = u'áèïöúñ'
py> print foo
áèïöúñ
py> print foo.upper()
ÁÈÏÖÚÑ

I just to check it in the python shell and it's correct.
Then the problem is by iPython that I was testing it from there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top