Sublime Text 2 is a good cross-platform code editor. However, people are crazy about garbled text on English mac platforms. It took more than a year to use sublime Text, now, let's take a look at the official documents and plug-ins and find a solution. To solve the problem, make Sublime Text 2 support GB2312 and GBK. The procedure is as follows:
1. Install Sublime Package Control.
Use Command + ~ on Sublime Text 2 ~ (Use ctrl + ~ in windows ~) Open the console and enter the following code in it. Sublime Text 2 will automatically install 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 ')
2. Restart Sublime Text 2
3. Press Ctrl + Shift + P to open the command line mode, and enter Install Package to search for the required Package.
4. Generally, "ConvertToUTF8" and "GBK Encoding Support" are used to read and write files in CJK format.