From: Neil Watkiss <neilw@ActiveState.com> - 2002-07-03 18:33:23
Steve Howell [03/07/02 14:20 -0400]:
> unicode: "Sosa did fine.\u263A"
> Does anybody know how to translate the above YAML into Python?
>>> u =3D u"Sosa did fine.\u263A"
u'Sosa did fine.\u263a'
>>> print u
Traceback (most recent call last):
File "<stdin>", line 1, in ?
UnicodeError: ASCII encoding error: ordinal not in range(128)
>>> print u.encode("utf-8")
Sosa did fine.=E2
Use 'xterm -u8' to get an xterm which can display UTF-8 characters.
Unfortunately, I don't have the correct fontpacks installed for this
character to come through correctly.
From: Clark C . Evans <cce@cl...> - 2002-07-03 18:44:51
On Wed, Jul 03, 2002 at 02:20:04PM -0400, Steve Howell wrote:
| unicode: "Sosa did fine.\u263A"
| Does anybody know how to translate the above YAML into Python?
You can look at the python specific code in libyaml, it
makes a few calls to unicode functions that have
equivalents in python itself. (I assume you mean converting
an ASCII string to Unicode)?