[issue21051] incorrect utf-8 conversion with c api

David Zámek report at bugs.python.org
Mon Mar 24 17:17:02 CET 2014


New submission from David Zámek:

I use python 2.7.6 on win32.

If I enter u'\u010d'.encode('utf-8') to console, I get '\xc4\x8d' as response. That's correct.

But it I use C API for the same, I get incorrect '\xc3\xa8' as response. 

I was testing it on this program:

#include <Python.h>
int main() {
Py_Initialize();
PyObject* dict = PyDict_New();
PyRun_String("u'\u010d'.encode('utf-8')", Py_single_input, dict, dict);
Py_DECREF(dict);
}

----------
components: Unicode
messages: 214693
nosy: dzaamek, ezio.melotti, haypo
priority: normal
severity: normal
status: open
title: incorrect utf-8 conversion with c api
type: behavior
versions: Python 2.7

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


More information about the Python-bugs-list mailing list