Sublime Text 2 is a very good source code and text editor, but does not support GB2312 and GBK encoding can be cumbersome in many cases. However, sublime Package control allows the plugin to allow sublime text 2 to almost perfectly support CJK-encoded text.
Installing sublime Package control is very simple, open the console with ctrl+~ on sublime Text 2 and enter the following code in it, or the code provided by the official. Sublime Text 2 automatically installs package control.
Import Urllib2,os;
pf= ' Package control.sublime-package ';
Ipp=sublime.installed_packages_path ();
Os.makedirs (IPP) if not os.path.exists (IPP) else None;
Urllib2.install_opener (Urllib2.build_opener) (urllib2. Proxyhandler ()));
Open (Os.path.join (IPP,PF), ' WB '). Write (Urllib2.urlopen (' http://sublime.wbond.net/' +pf.replace ('), '%20 '). Read () );
print ' Please restart Sublime Text to finish installation '
If the method is not properly installed, you can also install it directly by copying the file. If sublime text 2 is installed in a Chinese-language path, or if the%username% of the system path contains characters, you may need to install them manually. Open the Preferences menu and select Browse Packages ... The system opens the Packages folder for Sublime Text 2, goes back to the previous level menu, and then opens the installed Packages folder to download and download the package Control.sublime-package Copy to Installed Packages folder (Note that this is installed Packages, not Packages folder) restart Sublime Text 2
Then use Ctrl+shift+p to open the command line mode, in which you can enter install package to search for the package. Generally use "ConvertToUTF8" and "GBK Encoding Support" to read and write the files in CJK format normally.
Similarly, if sublime text 2 is installed in a Chinese-language path, or if the%username% of the system path contains characters, you may need to manually install these package and copy them to the package directory.