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
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
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
>
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
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
"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