[Patches] [ python-Patches-683515 ] Add unicode support to compile(), eval() and exec
SourceForge.net
noreply@sourceforge.net
Mon, 10 Feb 2003 00:28:43 -0800
Patches item #683515, was opened at 2003-02-09 20:01
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=683515&group_id=5470
Category: Core (C code)
Group: Python 2.3
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Just van Rossum (jvr)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add unicode support to compile(), eval() and exec
Initial Comment:
Attached is a patch that adds "real" unicode support to compile(), eval() and exec. This is done by adding a new PyCompilerFlags flag called PyCF_SOURCE_IS_UTF8. Unicode strings are converted to utf-8 and this flag is set. I've added tests to test_builtin.py for compile and eval, but I don't know how/where to test exec.
----------------------------------------------------------------------
>Comment By: Just van Rossum (jvr)
Date: 2003-02-10 09:28
Message:
Logged In: YES
user_id=92689
Thanks, it's been checked in.
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2003-02-10 04:06
Message:
Logged In: YES
user_id=33168
The code which uses unicode APIs should probably be wrapped
with:
#ifdef Py_USING_UNICODE
/* code */
#endif
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2003-02-10 02:28
Message:
Logged In: YES
user_id=6380
This is not a full review, but if this doesn't break any
unit tests, now is the time to check it in.
----------------------------------------------------------------------
Comment By: Just van Rossum (jvr)
Date: 2003-02-09 21:56
Message:
Logged In: YES
user_id=92689
Updated the patch for current CVS.
(Btw. if it were easy to obtain a utf-8 string with a bom mark, I think that should be preferable to adding the new compile flag. But it's not...)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=683515&group_id=5470