如何给sublime text 2安装中文扩展解决中文乱码问题

首先我们要安装install package:


参考这里:

http://www.unicac.cn/share/Sublime-Package-Control.html

https://sublime.wbond.net/installation#st2


首先按键control + ~


输入:

import urllib2,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; 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://sublime.wbond.net/' + 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')






然后我们shift+command+P,搜索install,会看见已经安装了:




我们进入install package,然后搜索我们想要的converttoutf8:





选择第一项,安装:




安装成功之后:





如果我们的文件是gbk的,我们需要再安装GBK Encoding Support :




之后我们打开文件,就会看见所有中文不再是乱码了~~~



另外需要说明一下,已经安装的插件就不会出现在install package的搜索项里了~~




再插一句,其中这句英文:


If for some reason the console installation instructions do not work for you (such as having a proxy on your network), perform the following steps to manually install Package Control:

  1. Click the Preferences > Browse Packages… menu
  2. Browse up a folder and then into the Installed Packages/folder
  3. Download Package Control.sublime-package and copy it into the Installed Packages/ directory
  4. Restart Sublime Text

其实这段的意思是当你shift+command+p的时候,也就是当你install packages不能正常显示的时候,教你怎么修复的,其中:

browse up a folder的意思,非常形象,也就是说当你执行了1步骤的时候,会弹出一个文件夹浏览框的意思,然后下载文件copy的这个文件夹,重启,然后你的install packages功能就会正常的意思~~~

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值