converting u'11\xa022' to '11\xa022'

Jean-Paul Calderone exarkun at divmod.com
Tue Feb 20 19:22:01 EST 2007



On Tue, 20 Feb 2007 18:12:42 -0600, alf <ask at me.xs4all.nl> wrote:
>Hi,
>is there a more elegant way to do that:
>
>''.join([chr(ord(i)) for i in u'11\xa022' ])
>

  u'11\xa022'.encode('charmap')

Jean-Paul



More information about the Python-list mailing list