escape
Links
- URL encoding the space character: + or %20?
%20
in the path before the query string.
+
in the query string.
- However, using
+
everywhere should be good enough.
- Url
urllib.quote_plus(string.encode('utf-8'))
urllib.unquote_plus(string.encode('utf-8'), safe='/')
safe
defaults to "/" for urllib.quote
but
not for urllib.quote_plus
.
- Html
markupsafe.escape(string) or cgi.escape(string, True)
- use
htmlentitydefs
stuff to decode.
- DataUri
"data:text/html;base64," + urllib.quote_plus(base64.standard_b64encode(content))
- Replace "text/html" with the right mime type.