首页 > 代码库 > Sublime Text 3技巧:支持GB2312和GBK编码

Sublime Text 3技巧:支持GB2312和GBK编码



View > Show Console


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://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)


Ctrl + Shift + P --> install package --> ConvertToUTF8


wKioL1SDCiDxI222AAMNrVFRgjc006.jpg




参考文章:https://sublime.wbond.net/installation#st3


本文出自 “炉火纯青” 博客,请务必保留此出处http://alipay.blog.51cto.com/7119970/1587185

Sublime Text 3技巧:支持GB2312和GBK编码