一、文本出现中文乱码问题
1、打开Sublime Text 3,按Ctrl+~打开控制行,复制粘贴以下python代码,然后回车运行。
- import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404e330c659d4bb41d3bdf022e94cab3cd0'; 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)
- import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404e330c659d4bb41d3bdf022e94cab3cd0'; 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。
3、按Ctrl+Shift+P打开命令行,输入Install Package,回车,然后继续输入ConvertToUTF8,回车。
等安装好了以后,应该问题就解决了,如果还是不行,再按照安装ConvertToUTF8的方式安装GBK Encoding Support,就好了。
二、tab中文出现方块问题:
在sublime text 3中,Preference, Settings-User,添加:
写道
"dpi_scale": 1.0,
我的Settings-User配置:
写道
{
"dpi_scale": 1.0,
"font_face": "Consolas",
"font_size": 17,
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 1,
"line_padding_top": 1,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"word_wrap": "true"
}
"dpi_scale": 1.0,
"font_face": "Consolas",
"font_size": 17,
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 1,
"line_padding_top": 1,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"word_wrap": "true"
}