编译后的乱码问题
声明:本人编译乱码问题已解决后写的文章,没有办法复现问题了,乱码问题的图片引用如下链接文中的:
https://blog.csdn.net/weixin_34406061/article/details/88843341
编译后的输出:中文显示异常:
编译C出现乱码问题解决
点击Preferences->Brpwse Packages->User
将自己之前配置好添加好的编译系统配置文件MosesMinCompileSettingC.sublime-build配置文件中的代码修改为:
{
"cmd": ["g++","-Wall", "${file}", "-fexec-charset=utf8","-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"encoding":"cp936",
"variants":
[
{
"name": "RunC",
"cmd": ["cmd", "/c", "g++", "-Wall","${file}", "-o", "${file_path}/${file_base_name}", "&&", "cmd", "/c", "${file_path}/${file_base_name}"]
},
{
"name": "RunInCommand",
"cmd": ["cmd", "/c", "g++", "-Wall","${file}", "-o", "${file_path}/${file_base_name}", "&&", "start", "cmd", "/c", "${file_path}/${file_base_name} & echo.&pause"]
}
]
}
其实只是在原来文件内容的基础上,在第一行中添加了:
"-fexec-charset=utf8"
有不懂的参考本人之前的文章:
01 sublime text3下配置c/c++ 的编译运行环境
Python:
点击Preferences->Brpwse Packages->User
将自己之前配置好添加好的编译系统配置文件MosesMinCompileSettingAnaconda3Python.sublime-build配置文件中的代码修改为:
{
"variants":
[
{
"name": "RunAnaconda3Python",
"cmd": ["E:/ProgramFilesAI/Anaconda3/python.exe","-u","$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"env": {"PYTHONIOENCODING": "utf8"},
"selector": "source.python",
},
]
}
其实只是在原来文件内容的基础上,添加了:
"env": {"PYTHONIOENCODING": "utf8"},
有不懂的参考本人之前的文章:
02 sublime text3下配置Python的编译运行环境
Java中没有出现乱码问题
参考本人之前文章:
03 sublime text3下配置Java的编译运行环境