"Clodoaldo" <clodoaldo.pinto at gmail.com> wrote in message news:1180453921.357081.89500 at n15g2000prd.googlegroups.com... >I was looking for a function to transform a unicode string into >htmlentities. >>> u'São Paulo'.encode('ascii', 'xmlcharrefreplace') 'São Paulo'