First off, I just have to correct your terminology. "exec" is a statement, and doesn't require parentheses, so talking about "exec()" invites confusion.
I'll answer your question in terms of eval(), which takes a string
representing a Python expression, interprets it, and returns the result.
In Python 2.3, the following works right:
>>> eval(u"u'\u0190'")
u'\u0190'
Here, the string passed to eval() contains the literal LATIN CAPITAL
LETTER OPEN E, and the expected unicode string is returned
The following behaves "surprisingly":
>>> eval(u"'\u0190'")
'\xc6\x90'
... you seem to get the UTF-8 encoding of the unicode.
This is related to PEP 263 (http://www.python.org/peps/pep-0263.html)
but the behavior of compile(), eval() and exec don't seem to be spelled
out.
Jeff
pgp7R8SrUm3oO.pgp
Description: PGP signature
-- http://mail.python.org/mailman/listinfo/python-list
