I want to convert, in python, special characters like "%$!&@á é ©" and not only '<&">' as all the documentation and references I’ve found so far shows. cgi.escape doesn’t solve the problem.
For example, the string "á ê ĩ &" should be converted to "á ê ĩ &".
Does anyboy know how to solve it?
I’m using python 2.6.
You could build your own loop using the dictionaries you can find in http://docs.python.org/library/htmllib.html#module-htmlentitydefs
The one you’re looking for is
htmlentitydefs.codepoint2name