[issue21051] incorrect utf-8 conversion with c api

2014-07-03 Thread Ezio Melotti
Changes by Ezio Melotti : -- stage: -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue21051] incorrect utf-8 conversion with c api

2014-03-24 Thread Mark Dickinson
Mark Dickinson added the comment: > I suspect that the actual bytes you get depend on your locale. And from the output you're seeing, I'd guess that Windows is using the CP1250 (Latin: Central European) codepage to make the translation on your machine: http://en.wikipedia.org/wiki/Windows-1250

[issue21051] incorrect utf-8 conversion with c api

2014-03-24 Thread Mark Dickinson
Mark Dickinson added the comment: Indeed: the \u010d is being interpreted by your *C compiler* as a multibyte character, and the individual bytes of that multibyte character end up in the string that you actually pass to Python. I suspect that the actual bytes you get depend on your locale.

[issue21051] incorrect utf-8 conversion with c api

2014-03-24 Thread STINNER Victor
STINNER Victor added the comment: In the C language, \u must be escaped as "\\u". -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue21051] incorrect utf-8 conversion with c api

2014-03-24 Thread David Zámek
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 int main() { Py_I