Python and UTF-8

Giorgi Lekishvili gleki at gol.ge
Thu Jan 3 13:45:30 EST 2002


I wonder if you find time to give me a hint where can I get the information
on which encoding schemes are currently suported in Python...
Grtz,
Giorgi

"Martin v. Loewis" wrote:

> Brandvik <tmagna at online.no> writes:
>
> > Is it possible to make a python script that would change the character
> > to UTF-8 no matter what the encoding of the input is? I have heard
> > that Python has some great functions for Unicode formatting so this
> > might be an easy and trivial task, but I'm new to Python so I really
> > don't know...
>
> You have to know the encoding the data is currently, say
> current_encoding. Then, converting it into UTF-8, you write
>
> data = unicode(data, current_encoding).encode('utf-8')
>
> HTH,
> Martin




More information about the Python-list mailing list