question on charset conversion

Peter Maas fpetermaas at netscape.net
Tue Mar 23 09:06:57 EST 2004


Lukas Holcik wrote:
> Would you mind answering a question to a Python newbie?:) Here it is: I
> have to download a page with windows-1250 and parse it and convert it to
> iso-8859-2. It there some easy way to acomplish this task using the
> standard distribution built-in modules? Or do I have to get some extra?

iso8859_2_string = unicode(cp1250_string, 'cp1250').encode('iso-8859-2')

Mit freundlichen Gruessen,

Peter Maas

-- 
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
Tel +49-241-93878-0 Fax +49-241-93878-20 eMail peter.maas at mplusr.de
-------------------------------------------------------------------



More information about the Python-list mailing list