[Chicago] unicode -> xml

Brian Ray bray at sent.com
Thu Feb 19 17:40:50 CET 2009


On Feb 19, 2009, at 10:23 AM, Massimo Di Pierro wrote:

> problem. Given
>
> >>> a=chr(245).decode('latin-1').encode('utf8','xmlcharref')
> >>> print a
> õ
>
> how do I translate this into valid escaped XML "&U+xxxx;" in the  
> general case?
>

This reference mentions something along those lines:

   <http://www.xml.com/pub/a/2005/06/15/py-xml.html>

Does this help?

Brian Ray





More information about the Chicago mailing list