sublime编译运行c语言后中文乱码的解决

来源:互联网 发布:淘宝店拍照技巧 编辑:程序博客网 时间:2024/06/03 17:36
  1. tools>Build System>New Build System中写入
{ "cmd": ["gcc", "${file}", "-fexec-charset=gbk","-o", "${file_path}/${file_base_name}", "&", "start", "cmd", "/c", "${file_base_name} & echo. & pause"], "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "working_dir": "${file_path}", "selector": "source.c, source.c++", "shell": true, "encoding":"cp936",}2. 保存为g++.sublime-build即可3. 然后ctrl+shift+b选择g++编译

关键是加上"-fexec-charset=gbk"

0 0
原创粉丝点击