[issue9769] PyUnicode_FromFormatV() doesn't handle non-ascii text correctly

Amaury Forgeot d'Arc report at bugs.python.org
Wed Sep 8 01:54:13 CEST 2010


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

> > PyUnicode_FromFormat("%s", text) expects a utf-8 buffer.
> Really?

The *format* looks more like latin-1, right. But the payload of a "%s" item is decoded as utf-8.

> I don't think that a C file calls PyErr_Format() or
> PyUnicode_FromFormat(V)() with a non-ascii format string.

At the moment, it's true. My remark is that utf-8 tend to be applied to all kind of files; if someone once decide that non-ascii chars are allowed in (some) string constants, they will be stored in utf-8.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9769>
_______________________________________


More information about the Python-bugs-list mailing list