Unicode to HTML entities

Clodoaldo clodoaldo.pinto at gmail.com
Tue May 29 12:11:15 EDT 2007


On May 29, 12:57 pm, "Richard Brodie" <R.Bro... at rl.ac.uk> wrote:
> "Clodoaldo" <clodoaldo.pi... 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'

That was a fast answer. I would never find that myself.

Thanks, Clodoaldo




More information about the Python-list mailing list