valide html - Encoding/Decoding
gene tani
gene.tani at gmail.com
Tue Dec 20 02:30:29 EST 2005
rabby wrote:
> hello world!
> how to get the string "/ + ( ) + \ + [ ] + : + äöü" converted into
> valide html.
> "...".decode("html") does not run :(
> thank you for help
the a-umlaut <=> ä and other translations are in htmlentitydefs,
like Dennis said.
cgi.escape will give you < & "e; etc, xml.sax.saxutils has
parallel functions
http://docs.python.org/lib/module-xml.sax.saxutils.html
of the RFC 1738 encodings you need to do for chars in URLs, i believe
"~" is the only one you commonly have to worry about so rewrite as
"%7E" manually...
More information about the Python-list
mailing list