zoukankan      html  css  js  c++  java
  • Sublime的中文GBK显示乱码的解决方法

    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')

    This code creates the Installed Packages folder for you (if necessary), and then downloads the Package Control.sublime-package into it. The download will be done over HTTP instead of HTTPS due to Python standard library limitations, however the file will be validated using SHA-256.

    WARNING: Please do not redistribute the install code via another website. It will change with every release. Instead, please link to this page.

    ctrl+~开打控制台,输入以上代码。

    重新启动

    ctrl+shift+P打开命令。输入GBK 然后使用Ctrl+Shift+P打开命令行模式,在里面输入Install Package就可以搜索须要的Package。

    一般使用“ConvertToUTF8”和“GBK Encoding Support”就可以正常读取和写入CJK格式的文件了。

  • 相关阅读:
    easyui_1
    JSONOBJECT
    基础回顾—list遍历4种
    <input type=file>上传唯一控件
    window.open
    poi--导入
    java字符串的替换
    一、IIS搭建前端静态模板_资源加载问题
    一、ASP.NET Iframework_SignalR集线器类(v2)
    一、ASP.NET Iframework_SignalR永久连接类(v2)
  • 原文地址:https://www.cnblogs.com/yxwkf/p/5387399.html
Copyright © 2011-2022 走看看