"convert" string to bytes without changing data (encoding)

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu Mar 29 02:02:37 CEST 2012


On Wed, 28 Mar 2012 15:43:31 -0400, Ross Ridge wrote:

> I can in
> fact say what the internal byte string representation of strings is any
> given build of Python 3.

Don't keep us in suspense! Given:

Python 3.2.2 (default, Mar  4 2012, 10:50:33)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2

what *is* the internal byte representation of the string "a∫©πz"?

(lowercase a, integral sign, copyright symbol, lowercase Greek pi, 
lowercase z)


And more importantly, given that internal byte representation, what could 
you do with it?


-- 
Steven



More information about the Python-list mailing list