➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 brett.cannon
收信人 amaury.forgeotdarc, brett.cannon, sjmachin
日期 2009-01-03.01:13:44
SpamBayes Score 1.2699788e-07
Marked as misclassified 否
Message-id <1230945228.36.0.298587550738.issue4626@psf.upfronthosting.co.za>
In-reply-to
内容
Here is what I have found out so far.
Python/bltinmodule.c:builtin_compile takes in a PyObject and gets the
char * representation of that object and passes it to
Python/pythonrun.c:Py_CompileStringFlags. Unfortunately no other
information is passed along in the call, including what the encoding
happens to be. This is unfortunate as builtin_compile makes sure that
the char* data is encoded using the default encoding before calling
Py_CompileStringFlags.

I just tried setting a PyCF flag to denote that the char* data is
encoded using the default encoding, but Parser/tokenizer.c is not
compiled against unicodeobject.c and thus one cannot use
PyUnicode_GetDefaultEncoding() to know what the data is stored as.

I'm going to try to explicitly convert to UTF-8 and see if that works.
历史
日期 用户 动作 参数
2009-01-03 01:13:48brett.cannon修改recipients: + brett.cannon, sjmachin, amaury.forgeotdarc
2009-01-03 01:13:48brett.cannon修改messageid: <1230945228.36.0.298587550738.issue4626@psf.upfronthosting.co.za>
2009-01-03 01:13:47brett.cannon链接issue4626 messages
2009-01-03 01:13:45brett.cannon创建