Home > Development Tools > sublime > body text

How to set SublimeText to support Chinese encoding

藏色散人
Release: 2020-08-28 11:45:03
forward
5676 people have browsed it

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!

How to set SublimeText to support Chinese encoding

#Set SublimeText to support Chinese encoding

1. Install Package Control

Menu Bar–> View –> Show 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)
Copy after login
If it is SublimeText2, then copy the following paragraph and paste it into the 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')
Copy after login
Please refer to the URL for the above code: https://packagecontrol.io/installation

2. 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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template