[issue43091] console encode is not utf-8!!

2021-02-01 Thread twoone3
twoone3 <3197653...@qq.com> added the comment: Thank you for solving my problem -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue43091] console encode is not utf-8!!

2021-02-01 Thread Eryk Sun
Eryk Sun added the comment: I assume you're linking to the CRT dynamically, which is shared with "python39.dll", which means you're sharing the configured locale with Python. Since you're not using an isolated configuration, the LC_CTYPE locale will be set to the current user's default local

[issue43091] console encode is not utf-8!!

2021-02-01 Thread twoone3
twoone3 <3197653...@qq.com> added the comment: when i use python 3.6.5 There won't be this problem -- ___ Python tracker ___ ___ Pyt

[issue43091] console encode is not utf-8!!

2021-02-01 Thread Christian Heimes
Christian Heimes added the comment: It's not a Python problem. The Python configuration API only configures Python's input/output API to UTF-8 mode. It does not affect the C++ input/output cout API. -- resolution: -> not a bug stage: -> resolved status: open -> closed

[issue43091] console encode is not utf-8!!

2021-02-01 Thread twoone3
twoone3 <3197653...@qq.com> added the comment: Look it! It's really Python's problem -- Added file: https://bugs.python.org/file49785/389e661314157b8f.jpg ___ Python tracker __

[issue43091] console encode is not utf-8!!

2021-02-01 Thread STINNER Victor
STINNER Victor added the comment: PyPreConfig.utf8_mode=1 enables the *Python* UTF-8 Mode: * https://docs.python.org/dev/c-api/init_config.html?highlight=pypreconfig_initpythonconfig#c.PyPreConfig.utf8_mode * https://docs.python.org/dev/library/os.html#utf8-mode > then i 'cout << u8"Chinese中文"

[issue43091] console encode is not utf-8!!

2021-02-01 Thread twoone3
twoone3 <3197653...@qq.com> added the comment: This is out put -- Added file: https://bugs.python.org/file49784/Screenshot_2021_0201_225300.png ___ Python tracker ___ _

[issue43091] console encode is not utf-8!!

2021-02-01 Thread twoone3
twoone3 <3197653...@qq.com> added the comment: After I changed it to 1, the console code remained unchanged. I use' chcp 65001' first. then i use PyPreConfig and Py_initialize then i 'cout << u8"Chinese中文" << endl; It is not utf-8. -- ___ Python track

[issue43091] console encode is not utf-8!!

2021-02-01 Thread Christian Heimes
Christian Heimes added the comment: "utf8_mode = -1" falls back to command line, env vars, locales, and eventually disables UTF-8 mode. Try "cfg.utf8_mode = 1" as documented at https://docs.python.org/3/c-api/init_config.html?highlight=pypreconfig_initpythonconfig#c.Py_PreInitializeFromArgs

[issue43091] console encode is not utf-8!!

2021-02-01 Thread twoone3
twoone3 <3197653...@qq.com> added the comment: PyPreConfig cfg; PyPreConfig_InitPythonConfig(&cfg); cfg.utf8_mode = -1; PyStatus status = Py_PreInitialize(&cfg); if (PyStatus_Exception(status)) { Py_ExitStatu

[issue43091] console encode is not utf-8!!

2021-02-01 Thread Christian Heimes
Christian Heimes added the comment: What's the result of the Py_PreInitialize(&cfg) call? -- nosy: +christian.heimes ___ Python tracker ___ ___

[issue43091] console encode is not utf-8!!

2021-02-01 Thread twoone3
New submission from twoone3 <3197653...@qq.com>: https://docs.python.org/3/c-api/init_config.html?highlight=pypreconfig_initpythonconfig#c.PyPreConfig When I use this api,The coding of the console has not changed,utf8_mode is 1. This is my code. PyPreConfig_InitPythonConfig(&cfg); cfg.utf8_mode