解决Sublime Text 3 中文乱码

时间:2023-03-09 20:07:54
解决Sublime Text 3  中文乱码

1、按ctrl+~快捷键,调出一个小文本款,然后粘贴以下代码:

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://sublime.wbond.net/' + 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)

2、安装完后重启下Sublime Text 3,在perferences选项一栏下面就会多了个Package Control

3、点击Package Control,上面会出来一个输入框,我们输入install package,输入框会消失,稍等一下又会弹出个输入框。

4、输入需要安装的那个插件包(ConvertToUTF8)