临时解决方案
如果在windows时发现clion乱码,可以在cmakelist.txt中:
- c++在cmakelist.txt添加
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fexec-charset=GBK")
- c语言在cmakelist.txt添加
CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fexec-charset=GBK"
终极解决方案
![在这里插入图片描述](https://img-blog.csdnimg.cn/33dea370036648758e5e79b6a0ab36f3.png)
保存关闭后,还需要取消run.processes.with.pty
- 方法一:按住 Ctrl+Shift+Alt+/,选中Registry…,然后取消run.processes.with.pty
- 方法二:或者Help->Find Action->输入Registry… ,然后取消run.processes.with.pty
![在这里插入图片描述](https://img-blog.csdnimg.cn/d7a92b5b4e8945649c8ab891148d7f66.png)
![在这里插入图片描述](https://img-blog.csdnimg.cn/a5a6c52fb6fd47a3a525d2a1f5520754.png)
- 方法三: 找到CLion的安装目录,比如D:\Program Files\JetBrains\CLion 2018.2\bin,然后打开idea.properties文件,将run.processes.with.pty设置为false即可。如下图:
![在这里插入图片描述](https://img-blog.csdnimg.cn/a4418865dc6e4dbbbfc2b2d653b6baf8.png)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)