[Python-3000] Unicode and OS strings
Barry Warsaw
barry at python.org
Fri Sep 14 13:30:10 CEST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sep 14, 2007, at 1:08 AM, Greg Ewing wrote:
> Stephen J. Turnbull wrote:
>> You can't win that, because Unicode is the only encoding that
>> attempts
>> to guarantee even the possibility of round-tripping.
>
> Rubbish -- I can do print [ord(c) for c in my_unicode_string]
> and get perfect round-trippability if I want.
I think my_unicode_string.encode('raw-unicode-escape) is equivalent.
- -Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
iQCVAwUBRupww3EjvBPtnXfVAQKBWAP/dU7eBsgvg704+beCPRbcKkFJvQuVd7br
D0irSae0P4IxQDC36dlVE+nUFvKWQDx0UPBmFfWb7CYZnmGpS+Z1hBNLzKy+5POJ
A4KSVV9nv1+YGKZBna1zgxuiP9EEHo7MqPm5PxKHmMHqpmcns3U6hZxutBCXN7Sw
pics7Kb7s6s=
=fiv7
-----END PGP SIGNATURE-----
More information about the Python-3000
mailing list