zoukankan      html  css  js  c++  java
  • 用sublime text 2 编译Ruby 遇到编码的问题(UnicodeDecodeError: 'ascii' codec can't decode byte 0xc0 in position 9: ordinal not in range(128))

    Ctrl+B编译遇到编码错误:UnicodeDecodeError: 'ascii' codec can't decode byte 0xb1 in position 258: ordinal not in range(128) 
     

    路径为:C:Users您的用户名AppDataRoamingSublime Text 2PackagesDefaultexec.py,打开编辑

    找到第44~45行中:

    for k, v in proc_env.iteritems():

     proc_env[k] = os.path.expandvars(v).encode(sys.getfilesystemencoding())

    两种修改方案:

    1、果断注释掉!

    2、对它进行异常处理,避免它出错时停止程序运行就像这样:

      
      for k, v in proc_env.iteritems():
                try:
                    proc_env[k] = os.path.expandvars(v).encode(sys.getfilesystemencoding())
                except UnicodeDecodeError:
                    print "Encoding error..."
                    print "VARIABLE: ", k, " : ", v

  • 相关阅读:
    iOS设计模式-工厂方法
    iOS设计模式-原型模式
    (转)iOS 屏幕适配
    iOS设计模式-MVC
    转 常用第三方库
    学习资料收集
    xcode 插件
    CocoaPods安装和使用
    iOS 友盟统计的bug分析
    HTML——表格
  • 原文地址:https://www.cnblogs.com/lee0201/p/sublimetext2_UnicodeDecodeError_ascii.html
Copyright © 2011-2022 走看看