python类utf_7_decode()的实例源码

utf_7.py 文件源码 项目:Price-Comparator 作者: Thejas-1 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:oil 作者: oilshell 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
test_codecs.py 文件源码 项目:oil 作者: oilshell 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def test_errors(self):
        tests = [
            ('\xe1b', u'\ufffdb'),
            ('a\xe1b', u'a\ufffdb'),
            ('a\xe1\xe1b', u'a\ufffd\ufffdb'),
            ('a+IK', u'a\ufffd'),
            ('a+IK-b', u'a\ufffdb'),
            ('a+IK,b', u'a\ufffdb'),
            ('a+IKx', u'a\u20ac\ufffd'),
            ('a+IKx-b', u'a\u20ac\ufffdb'),
            ('a+IKwgr', u'a\u20ac\ufffd'),
            ('a+IKwgr-b', u'a\u20ac\ufffdb'),
            ('a+IKwgr,', u'a\u20ac\ufffd'),
            ('a+IKwgr,-b', u'a\u20ac\ufffd-b'),
            ('a+IKwgrB', u'a\u20ac\u20ac\ufffd'),
            ('a+IKwgrB-b', u'a\u20ac\u20ac\ufffdb'),
            ('a+/,+IKw-b', u'a\ufffd\u20acb'),
            ('a+//,+IKw-b', u'a\ufffd\u20acb'),
            ('a+///,+IKw-b', u'a\uffff\ufffd\u20acb'),
            ('a+////,+IKw-b', u'a\uffff\ufffd\u20acb'),
            ('a+IKw-b\xe1', u'a\u20acb\ufffd'),
            ('a+IKw\xe1b', u'a\u20ac\ufffdb'),
        ]
        for raw, expected in tests:
            try:
                with self.assertRaises(UnicodeDecodeError):
                    codecs.utf_7_decode(raw, 'strict', True)
                self.assertEqual(raw.decode('utf-7', 'replace'), expected)
            except:
                print 'raw=%r' % raw
                raise
utf_7.py 文件源码 项目:python2-tracer 作者: extremecoders-re 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
test_codecs.py 文件源码 项目:python2-tracer 作者: extremecoders-re 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def test_errors(self):
        tests = [
            ('\xe1b', u'\ufffdb'),
            ('a\xe1b', u'a\ufffdb'),
            ('a\xe1\xe1b', u'a\ufffd\ufffdb'),
            ('a+IK', u'a\ufffd'),
            ('a+IK-b', u'a\ufffdb'),
            ('a+IK,b', u'a\ufffdb'),
            ('a+IKx', u'a\u20ac\ufffd'),
            ('a+IKx-b', u'a\u20ac\ufffdb'),
            ('a+IKwgr', u'a\u20ac\ufffd'),
            ('a+IKwgr-b', u'a\u20ac\ufffdb'),
            ('a+IKwgr,', u'a\u20ac\ufffd'),
            ('a+IKwgr,-b', u'a\u20ac\ufffd-b'),
            ('a+IKwgrB', u'a\u20ac\u20ac\ufffd'),
            ('a+IKwgrB-b', u'a\u20ac\u20ac\ufffdb'),
            ('a+/,+IKw-b', u'a\ufffd\u20acb'),
            ('a+//,+IKw-b', u'a\ufffd\u20acb'),
            ('a+///,+IKw-b', u'a\uffff\ufffd\u20acb'),
            ('a+////,+IKw-b', u'a\uffff\ufffd\u20acb'),
            ('a+IKw-b\xe1', u'a\u20acb\ufffd'),
            ('a+IKw\xe1b', u'a\u20ac\ufffdb'),
        ]
        for raw, expected in tests:
            try:
                with self.assertRaises(UnicodeDecodeError):
                    codecs.utf_7_decode(raw, 'strict', True)
                self.assertEqual(raw.decode('utf-7', 'replace'), expected)
            except:
                print 'raw=%r' % raw
                raise
utf_7.py 文件源码 项目:fieldsight-kobocat 作者: awemulya 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:chalktalk_docs 作者: loremIpsum1771 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:sslstrip-hsts-openwrt 作者: adde88 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:python-group-proj 作者: Sharcee 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:covar_me_app 作者: CovarMe 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:Callandtext 作者: iaora 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:NeuroMobile 作者: AndrewADykman 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:WebAct 作者: CreatCodeBuild 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:PornGuys 作者: followloda 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:remoteControlPPT 作者: htwenning 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:xxNet 作者: drzorm 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:ASE-Fall2016 作者: Dai0526 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:TodoListMaker 作者: prakharchoudhary 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:CloudPrint 作者: William-An 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)
utf_7.py 文件源码 项目:pefile.pypy 作者: cloudtracer 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)


问题


面经


文章

微信
公众号

扫码关注公众号