Home >Development Tools >sublime >How to set SublimeText to support Chinese encoding
The following tutorial column of sublime will introduce to you how to make SublimeText support Chinese encoding. I hope it will be helpful to friends in need!
#Set SublimeText to support Chinese encoding 1. Install Package ControlMenu Bar–> View –> Show ConsoleIf it is SublimeText2, then copy the following paragraph and paste it into the Console:
If it is SublimeText3, then copy the following paragraph and paste it into the 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)
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')
Please refer to the URL for the above code: https://packagecontrol.io/installation2. Install the ConvertToUTF8 plug-in
Menu bar–> Preference –> Package Control ,Enter "install package" in the input box, click "install package" that is automatically prompted below,
After a few seconds, a small window will pop up, enter "CovertToUTF8" and click install.
After a few seconds, the plug-in will be installed successfully.
I opened the previously garbled Chinese document and found that it could be displayed correctly.
The above is the detailed content of How to set SublimeText to support Chinese encoding. For more information, please follow other related articles on the PHP Chinese website!