[issue29907] Unicode encoding failure

2017-03-26 Thread Eryk Sun
Eryk Sun added the comment: I'm closing this issue since Python's encodings in this case -- 852 (OEM) and 1250 (ANSI) -- both correctly map U+0159: >>> u'\u0159'.encode('852') '\xfd' >>> u'\u0159'.encode('1250') '\xf8' You must be using an encoding that doesn't map U+0159. If

[issue29907] Unicode encoding failure

2017-03-26 Thread STINNER Victor
STINNER Victor added the comment: For Python 2, there is https://pypi.python.org/pypi/win_unicode_console -- ___ Python tracker ___

[issue29907] Unicode encoding failure

2017-03-26 Thread Paul Moore
Paul Moore added the comment: Also, you need to: 1. Ensure you are using characters that are available in the encoding that sys.stdout uses - in Python prior to 3.6, this would be your Windows *console* code page, and in 3.6+ would be UTF-8. 2. Declare the encoding of your source code if you

[issue29907] Unicode encoding failure

2017-03-26 Thread Martin Panter
Martin Panter added the comment: I presume you are trying to print to the normal Windows console. I understand the console was not well supported until Python 3.6 (see Issue 1602). Have you tried that version? I’ll leave this open for someone more experienced to confirm, but I suspect what

[issue29907] Unicode encoding failure

2017-03-25 Thread Robert Baker
New submission from Robert Baker: Using Python 2.7 (not IDLE) on Windows 10. I have tried to use a Python 2.7 program to print the name of Czech composer Antonín Dvořák. I remembered to add the "u" before the string, but regardless of whether I encode the caron-r as a literal character