#9891: Add entity2unicode in `django.utils.html`
-------------------------------------+--------------------------------------
 Reporter:  [email protected]  |       Owner:  nobody    
   Status:  new                      |   Milestone:            
Component:  Uncategorized            |     Version:  1.0       
 Keywords:                           |       Stage:  Unreviewed
Has_patch:  0                        |  
-------------------------------------+--------------------------------------
 The html utils of Django could have this function:
 {{{
 #!python
 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

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9891>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to