如何设置让SublimeText支持中文编码

下面由sublime教程栏目给大家介绍让SublimeText支持中文编码的方法,希望对需要的朋友有所帮助!

设置SublimeText支持中文编码1. 安装 Package Control

菜单栏 –> View –> Show Console

如果是SublimeText3, 那么复制下面一段话粘贴到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(' ', ' ')).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)

如果是SublimeText2, 那么复制下面一段话粘贴到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(' ', ' ')).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')

以上代码请参考网址: https://packagecontrol.io/installation

2.安装ConvertToUTF8插件

菜单栏 –> Preference –> Package Control,
输入框内输入”install package”, 点击下方自动提示出来的”install package”,
稍等几秒后, 弹出一个小窗口, 输入”CovertToUTF8”, 点击安装.
稍等几秒后, 插件即可安装成功.
打开之前中文乱码的文档, 发现已经可以正确显示了.

更多关于云服务器域名注册虚拟主机的问题,请访问西部数码官网:www.west.cn

赞(0)
声明:本网站发布的内容(图片、视频和文字)以原创、转载和分享网络内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-62778877-8306;邮箱:fanjiao@west.cn。本站原创内容未经允许不得转载,或转载时需注明出处:西部数码知识库 » 如何设置让SublimeText支持中文编码

登录

找回密码

注册