Degrees Niang for a long time have not found Mac OS solve sublime Text2 Chinese garbled problem of the tutorial,
So I thought for a while, studied and successfully in the Mac OS directly with the sublime Text2 open Chinese-language files.
(No need to open a DOS platform every time you have to go to Xcode to turn a code or something ...) )
The steps are as follows:
0. Open Sublime Text
1. control+ ' ~ ' to open the console,
Enter the command according to sublime package control, according to this website (https://sublime.wbond.net/installation#st2)
If it is sublime text3, it is as follows:
import urllib.request,os,hashlib;
h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0';
pf = 'Package Control.sublime-package';
ipp = sublime.installed_packages_path();
urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) );
by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read();
dh = hashlib.sha256(by).hexdigest();
print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
If it is sublime text2, it is as follows:
Import Urllib.request,os,hashlib;
h = ' 7183a2d3e96f11eeadd761d777e62404 ' + ' e330c659d4bb41d3bdf022e94cab3cd0 ';
PF = ' package control.sublime-package ';
IPP = Sublime.installed_packages_path ();
Urllib.request.install_opener (Urllib.request.build_opener (Urllib.request.ProxyHandler ()));
by = Urllib.request.urlopen (' http://packagecontrol.io/' + pf.replace (', '%20 ')). read ();
DH = hashlib.sha256 (by). Hexdigest ();
Print (' Error validating download (got%s instead of%s), please try manual install '% (DH, h)) if DH! = H Else Open (Os.pat H.join (IPP, PF), ' WB '). Write (by)
2. Enter the installation complete, restart sublime TEXT2/3
3. command+shift+p, open the Package control command line that you just installed
4. Enter the Install package
5. When it is loaded into the package directory, enter "ConvertToUTF8" or "GBK Encoding support" and then return to install
6. After installing the restart sublime Text2, you can see the beautiful Chinese characters appear!
Mac os solve sublime Text2 or 3 Chinese garbled problem