How to set SublimeText to support Chinese coding
This article mainly introduces how to set SublimeText to support Chinese coding, the article is very detailed, has a certain reference value, interested friends must read it!
Set SublimeText to support Chinese encoding
1. Install Package Control
Menu bar-> View-> Show Console
If it is SublimeText3, copy the following paragraph and paste it into Console:
Import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' +' ebe013ee18cced0ef93d5f746d80ef60'; 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 SublimeText2, copy the following paragraph and paste it into Console:
Import urllib2,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' +' ebe013ee18cced0ef93d5f746d80ef60'; 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 (); by = urllib2.urlopen (' http://packagecontrol.io/' + pf.replace ('','% 20')). Read (); dh = hashlib.sha256 (by). Hexdigest () Open (os.path.join (ipp, pf), 'wb'). Write (by) if dh = = h else None; print (' Error validating download (got% s instead of% s), please try manual install'% (dh, h) if dh! = h else 'Please restart Sublime Text to finish installation') 2. Install the ConvertToUTF8 plug-in
Menu bar-> Preference-> Package Control
Type "install package" in the input box, and click "install package" automatically prompted below.
After a few seconds, a small window pops up, type "CovertToUTF8" and click install.
After a few seconds, the plug-in can be installed successfully.
Open the previous Chinese garbled document and find that it can be displayed correctly.
The above is all the contents of the article "how to set SublimeText to support Chinese coding". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!