Opened 16 years ago
Closed 16 years ago
#9891 closed (wontfix)
Add entity2unicode in `django.utils.html`
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Uncategorized | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The html utils of Django could have this function:
import htmlentitydefs entity_re = re.compile('&([a-z]+);', re.I) def entity2unicode(text): for entity in entity_re.findall(text): print entity text = text.replace('&%s;'%entity, htmlentitydefs.entitydefs[entity].decode('iso-8859-1')) return text
Maybe it could be useful for someone else
Note:
See TracTickets
for help on using tickets.
Things in
django.utils
are mostly support functions for Django itself, not functions designed for external use.