469,929 Members | 1,797 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Decoding numerical and name based HTML entities

Hi all,

what would be the easiest way in Python to decode HTML entities to a unicode
string? I would need a function that supports both numerical as well as name
based HTML entities.

I already did some googling, but I only found a function that decoded
numerical ones, and this function didn't support unicode...

Cheers,
pieter
Jul 18 '05 #1
1 1874
Pieter Claerhout <Pi**************@creo.com> wrote:
Hi all,

what would be the easiest way in Python to decode HTML entities to a unicode
string? I would need a function that supports both numerical as well as name
based HTML entities.

I already did some googling, but I only found a function that decoded
numerical ones, and this function didn't support unicode...


Dictionary "table" would be first thing I'd try, ie.
tohtml['&'] = '&amp;'
fromhtml['&amp;'] = '&'

--
William Park, Open Geometry Consulting, <op**********@yahoo.ca>
Linux solution for data processing and document management.
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Anuj | last post: by
81 posts views Thread by Jonas Smithson | last post: by
10 posts views Thread by Andreas Gohr | last post: by
50 posts views Thread by The Bicycling Guitarist | last post: by
9 posts views Thread by Mark | last post: by
2 posts views Thread by FP | last post: by
42 posts views Thread by Santander | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.