By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,538 Members | 1,428 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,538 IT Pros & Developers. It's quick & easy.

Decoding numerical and name based HTML entities

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.