[I18n-sig] (no subject)

Tom Emerson tree@basistech.com
Fri, 24 Aug 2001 13:03:51 -0400

Colin Yu writes:
> Is there a way to take a unicode string like u"=E3=1B,C,=1B(B=E3=1B,C=
<=1B(B=E3=1B,B6=1B(B=E3=1B,C<=1B(B =E3=83=97=E3=1B,C*=1B(B=E3=1B,C3=1B(=
> (which are Japanese characters in UTF-8 format) and convert it to uni=
> (\uXXXX format) escape codes in python=3F  Your help would be greatly=
> appreciated. Thank you.

Use "repr".

>>> foo =3D u"\u4e00"
>>> repr(foo)

Tom Emerson                                          Basis Technology C=
Sr. Sinostringologist                              http://www.basistech=
  "Beware the lollipop of mediocrity: lick it once and you suck forever=