ubuntu18.04 终端运行cpp文件中文字符出现乱码

讲cpp文件转码即可
在windows下生成的cpp不是utf-8格式的,而linux终端只识别utf-8格式的,所以必须转码!

iconv -f gbk -t utf8 filename.cpp -o filename.cpp

或者在windows下预先将cpp转换为utf-8

原文地址:http://www.voidcn.com/article/p-nldppwyv-ra.html

猜你喜欢

转载自blog.csdn.net/qq_36974075/article/details/82491434