Python and UTF-8

John Roth johnroth at ameritech.net
Thu Jan 3 09:47:31 EST 2002


"Giorgi Lekishvili" <gleki at gol.ge> wrote in message
news:3C34A6CA.81EB93A1 at gol.ge...
> 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

It doesn't seem to be very well documented. The only way I
ever figured it out was to go into the Python21/Lib/encodings directory
and look.
>
> "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