温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

怎么设置SublimeText支持中文编码

发布时间:2020-12-10 10:22:36 来源:亿速云 阅读:326 作者:小新 栏目:软件技术

这篇文章主要介绍怎么设置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(' ', '%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)

如果是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(' ', '%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')

2.安装ConvertToUTF8插件

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

以上是“怎么设置SublimeText支持中文编码”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI