Re: Unicode to HTML entities

2007-05-30 Thread Clodoaldo
On May 30, 4:25 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > Clodoaldo <[EMAIL PROTECTED]> wrote: > > On May 29, 12:57 pm, "Richard Brodie" <[EMAIL PROTECTED]> wrote: > >> "Clodoaldo" <[EMAIL PROTECTED]> wrote in message > > >>news:[EMAIL PROTECTED] > > >> >I was looking for a function to transfor

Re: Unicode to HTML entities

2007-05-30 Thread Clodoaldo
On May 30, 8:53 am, Tommy Nordgren <[EMAIL PROTECTED]> wrote: > On 29 maj 2007, at 17.52, Clodoaldo wrote: > > > > > I was looking for a function to transform a unicode string into > > htmlentities. Not only the usual html escaping thing but all > > characters. > > > As I didn't find I wrote my own

Re: Unicode to HTML entities

2007-05-30 Thread Tommy Nordgren
On 29 maj 2007, at 17.52, Clodoaldo wrote: > I was looking for a function to transform a unicode string into > htmlentities. Not only the usual html escaping thing but all > characters. > > As I didn't find I wrote my own: > > # -*- coding: utf-8 -*- > from htmlentitydefs import codepoint2name >

Re: Unicode to HTML entities

2007-05-30 Thread Duncan Booth
Clodoaldo <[EMAIL PROTECTED]> wrote: > On May 29, 12:57 pm, "Richard Brodie" <[EMAIL PROTECTED]> wrote: >> "Clodoaldo" <[EMAIL PROTECTED]> wrote in message >> >> news:[EMAIL PROTECTED] >> >> >I was looking for a function to transform a unicode string into >> >htmlentities. >> >>> u'São Paulo'.enco

Re: Unicode to HTML entities

2007-05-29 Thread Clodoaldo
On May 29, 12:57 pm, "Richard Brodie" <[EMAIL PROTECTED]> wrote: > "Clodoaldo" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > >I was looking for a function to transform a unicode string into > >htmlentities. > >>> u'São Paulo'.encode('ascii', 'xmlcharrefreplace') > > 'São Paulo

Re: Unicode to HTML entities

2007-05-29 Thread Richard Brodie
"Clodoaldo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I was looking for a function to transform a unicode string into >htmlentities. >>> u'São Paulo'.encode('ascii', 'xmlcharrefreplace') 'São Paulo' -- http://mail.python.org/mailman/listinfo/python-list