sublime3 安装插件解决乱码

Mac 系统下中文乱码显示,需要使用Install Package 安装 ConvertToUTF8 插件
首先,安装install package :
sublime 界面快捷键: control + ~
输入:

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)

输出:

>>> 
Error validating download (got df21e130d211cfc94d9b0905775a7c0f1e3d39e33b79698005270310898eea76 instead of 7183a2d3e96f11eeadd761d777e62404e330c659d4bb41d3bdf022e94cab3cd0), please try manual install

需要使用新的id 替换旧的 id :

import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f1e3d39e33b79698005270310898eea76'; 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)

安装后,使用快捷键:command + shift + p
输入 Install Package 回车, 在新的界面输入:ConvertToUTF8 等待安装完成
如果提示: Error : Codecs missing
则需要下载Codes 找到对应系统并移动到
/Users/shake/Library/Application Support/Sublime Text 3/Package
对应的插件目录下,注意重命名文件夹为 Codecs33
参考:

Otherwise, you can download this repository as a zip file from one of the branchs (osx, linux-x64, linux-x32) which matchs your platform. Unzip the archive and rename the new folder to Codecs33, then move this folder to Packages folder of Sublime Text (You can find the Packages folder by clicking "Preferences > Browse Packages" menu entry in Sublime Text).








  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值