469,898 Members | 1,815 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

question on charset conversion

Hi all there!

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?
Thanks,

Lukas Holcik

(I'm using Python-2.3.3 on Linux)
Jul 18 '05 #1
1 1177
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 pe********@mplusr.de
-------------------------------------------------------------------
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by CJ Oxx | last post: by
12 posts views Thread by lawrence | last post: by
4 posts views Thread by Andrew Cowper | last post: by
2 posts views Thread by Brajesh Jain | last post: by
7 posts views Thread by Kevin | last post: by
16 posts views Thread by Duncan Mole | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.