Since the use of sublime has been using SUBLIME+GCC to write C programs, but there is a problem is disturbing people.
Generally new source file is Utf-8 encoding mode, but the Windows console is GBK encoding (sublime console cannot input, then give up, and call win cmd), Chinese display will cause garbled.
And win to modify the key value of the registry to support Utf-8, but after the modification, it will cause some trouble, Java will be garbled.
1.sublime using other console programs (unsuccessful, mentally wounded,, not)
2. In Baidu found a way, is to input commands in the console, temporarily modified to support Utf-8
CHCP // View the code page of the current console 65001 // change to Unicode code page
Think of modifying sublime compiled system configuration file, write a few more commands, before running the program to add Chcp 65001 in.
Tossing a few hours, incidentally understood some commands (below).
dir // dir/dir//dir// You can use cmd/? To view help information.
Talk less, attach the configuration code I changed.
1 {2 "cmd": ["GCC","${file}","- o","${file_path}/${file_base_name}"],3 "File_regex":"^(.. [^:]*]:([0-9]+):? ([0-9]+)?:? (.*)$",4 "Working_dir":"${file_path}",5 "selector":"source.c",6 7 "variants":8 [9 {Ten "name":"Run", One "cmd": ["cmd","/ C","GCC","${file}","- o","${file_path}/${file_base_name}","&&","Start","cmd","/ C","chcp 65001 && clear && ${file_path}/${file_base_name} && Pause"]} A ] -}
Line 11th && after cmd/c ..... is to chcp 65001 then clear (clear screen) finally execute the target program.
Also note that when you cannot display Chinese, change the console default font and adjust it yourself.
Test for changes to change the 11th line to
"cmd": ["cmd","/ C","GCC","${file}","- o","${file_path}/${file_base_name}","&&","Start","cmd","/k","chcp 65001 && clear && ${file_path}/${file_base_name} && Pause"]}
Only changed the/C to/k
After the test is finished, change the/k to/C.
A compiled system configuration file with two C is included. Put it under the sublime text\data\packages\user\.
Download
Sublime support Utf-8 C source code method, other garbled case reference.