问题1:
使用 Embarcadero Dev-C++ 编译器时,代码中的中文只有鼠标选中其所在行时才会显示,否则看不见。
鼠标选中所在行后:
解决方式:
菜单栏:Tools > Editor Options... > Fonts, 取消勾选<ID 27071 translation missing>。
问题2:
运行时,会显示乱码。
解决方式:
菜单栏: Tools > Compiler Options..., 勾选 Add the following commands when calling the compiler:
添加 -fexec-charset=gbk 命令行,重新编译运行。
另外,如果保存一个新的cpp文件里有中文,会弹出提示:
解决方式:
修改文件的默认编码为utf-8,菜单栏:Tools > Editor Options... > New Document Encoding 选择 UTF-8。