Embarcadero / Dev-Cpp

A fast, portable, simple, and free C/C++ IDE
https://www.embarcadero.com/free-tools/dev-cpp
GNU General Public License v2.0
2.59k stars 281 forks source link

Chinese output garbled #111

Open zhangfangyong opened 3 years ago

zhangfangyong commented 3 years ago

When I try to output Chinese on the console, the display is garbled. image My windows version is win10 20H2.

AKonia commented 3 years ago

Check your encoding settings in Dev-Cpp and in windows console, possibly they doesn't match

185264646 commented 3 years ago

Add system(chcp 65001);(don't forget to include stdlib.h first) before you print any Chinese or you must change the coding to ANSI rather than UTF8. This can be done by opening the original file with notepad.exe and save it in ANSI. Don't click yes when Dev-Cpp asks you to save the source file in UTF8.

2244583435 commented 3 years ago

我也是中文输出乱码,不管用什么方法都没用。 I am also Chinese output garbled, no matter what method is used, it is useless.

2244583435 commented 3 years ago

编写的时候,中文也无法正常显示。 When writing, Chinese can't be displayed normally.

lianix commented 3 years ago

To display the Chinese on edit , the Front such as "新宋体" which support Chinese needs to be set on Edit display item To print the Chinese on the console, the source file need to set "ANSI" code

ZhouJiatai commented 3 years ago

程序对ANSI编码的支持很不好 The program has poor support for ANSI coding See Issue #126

xumingkuan commented 3 years ago

https://github.com/Embarcadero/Dev-Cpp/issues/140#issuecomment-860181236

This works for me