To enable sublime text3 to support GBK encoding, the basic principle is to install package control, and then install the package of converttoutf8 through package control.
The method is as follows: press Ctrl + ~ Open the command line and enter
ImportUrllib. request, OS; pF = 'package control. sublime-package '; IPP = sublime. installed_packages_path (); urllib. request. install_opener (urllib. request. build_opener (urllib. request. proxyhandler (); open (OS. path. join (iPP, PF), 'wb '). write (urllib. request. urlopen ('HTTP: // sublime.wbond.net/'+ PF. replace ('', '% 20 ')). read ())
After running the command, restart the application.
Then, press Ctrl + Shift + P to open the search box, enter install package, and press Enter. All the packages are displayed. Search converttoutf8 and press enter to download the package.
Converttoutf8 is used to convert gb2312 and GBK files to utf8 encoding. Therefore, garbled characters will not occur when you open a GBK-encoded file later.
In addition, you can install the GBK encoding support package if you need to save it in GBK encoding after editing.
Sublime text3: Support GBK Encoding