Dev-Cpp icon indicating copy to clipboard operation
Dev-Cpp copied to clipboard

Chinese display error(汉字显示错误)

Open KyleJKC opened this issue 3 years ago • 8 comments

When I run my code with Chinese in it, it display it error. I search for some issues, and I have tried to select NO when it ask me to save the file in UTF-8, but it do not work. So how can I solve the problem image

KyleJKC avatar Apr 24 '21 02:04 KyleJKC

这是因为你编写的源文件是UTF-8编码, 但是命令提示符编码是GB936(中文编码), 所以会导致乱码. 新建文件的时候就可以选择文件的编码, 一般默认是ANSI, 保存的话也是

liuzhijun-source avatar Apr 24 '21 05:04 liuzhijun-source

这是因为你编写的源文件是UTF-8编码, 但是命令提示符编码是GB936(中文编码), 所以会导致乱码. 新建文件的时候就可以选择文件的编码, 一般默认是ANSI, 保存的话也是

我选的就是ANSI,保存的时候格式显示的也是ANSI,现在就不知道怎么办了

KyleJKC avatar Apr 24 '21 05:04 KyleJKC

Try to use Red Panda Dev Cpp

flopezre avatar May 10 '21 00:05 flopezre

I met the same problem. If I use utf-8 to save the code, I can open it again, but it will output chinese characters wrongly. If I use ANSI to save the code, it can't be opened in Devcpp again. It sends me an error report. And the old version devcpp didn't have this error.

Darius-H avatar May 27 '21 07:05 Darius-H

cmd下执行chcp 65001, 然后再执行程序(cmd下输入"没用.exe"执行)试试

hlizard avatar Jun 10 '21 02:06 hlizard

image My source file is utf-8, just use this compiler option, i can output hanzi in cmd。

Siogian avatar Jun 13 '21 09:06 Siogian

在你的电脑上勾选:Beta版:使用Unicode UTF-8 提供全球语言支持。然后把devcpp的默认编码改成UTF-8,就没有问题了。

image

image

muqian2022 avatar Feb 14 '24 14:02 muqian2022

但是这么做,会导致你使用devcpp的中文语言页面全部乱码,如果英语过关,devcpp换成英语界面,这样用着比较舒服。 或许现在可能不需要了。两年多了。

muqian2022 avatar Feb 14 '24 14:02 muqian2022