From 3aaf42c6139ed211a59b200130d1d205982b9818 Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Mon, 10 Feb 2003 08:21:10 +0000 Subject: patch #683515: "Add unicode support to compile(), eval() and exec" Incorporated nnorwitz's comment re. Py__USING_UNICODE. --- Python/compile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Python/compile.c') diff --git a/Python/compile.c b/Python/compile.c index 01e961b691..2b2a9d5389 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -4206,7 +4206,9 @@ jcompile(node *n, const char *filename, struct compiling *base, PyCodeObject *co; if (!com_init(&sc, filename)) return NULL; - if (TYPE(n) == encoding_decl) { + if (flags && flags->cf_flags & PyCF_SOURCE_IS_UTF8) { + sc.c_encoding = "utf-8"; + } else if (TYPE(n) == encoding_decl) { sc.c_encoding = STR(n); n = CHILD(n, 0); } else { -- cgit v1.2.1