码迷,mamicode.com
首页 > 其他好文 > 详细

扩展RF,解决打印的日志信息中出现\xad\xfs\xff\xaa这样的字符

时间:2015-02-11 23:19:24      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:

找到robot/utils/unic.py,修改_unic函数

def _unic(item, *args):
    try:
        return unicode(item, *args)
    except UnicodeError:
        try:
            return str(item).decode("UTF-8")
        except UnicodeError:
            try:
                return str(item).decode("GBK")
            except UnicodeError:
                try:
                    ascii_text = str(item).encode(string_escape)
                except:
                    return _unrepresentable_object(item)
                else:
                    return unicode(ascii_text)
    except:
        return _unrepresentable_object(item)

 

扩展RF,解决打印的日志信息中出现\xad\xfs\xff\xaa这样的字符

标签:

原文地址:http://www.cnblogs.com/njdoit/p/4287039.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!