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 <rep...@bugs.python.org>
<http://bugs.python.org/issue21051>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to