BeautifulSoup -converting unicode to numerical representaion

S.Selvam Siva s.selvamsiva at
Mon Feb 9 14:48:48 CET 2009

Hi all,

I need to parse feeds and post the data to SOLR.I want the special
characters(Unicode char) to be posted as numerical representation,

For eg,
*'* --> ’ (for which HTML equivalent is ’)
I used BeautifulSoup,which seems to be allowing conversion from "&#xxxx;"(
numeric values )to unicode characters as follow,


But i want *numerical representation of unicode characters.*
I also want to convert html representation like ’ to its numeric
equivalent ’

Thanks in advance.

The reason for the above requirement is i need a standard way to post to
SOLR to avoid errors.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list