Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(22)  |  Call(22)  |  Derive(0)  |  Import(0)

src/f/l/flanker-0.4.14/flanker/mime/message/headers/encodedword.py   flanker(Download)
                if start != 0:
                    # decodes unencoded ascii part to unicode
                    value = charsets.convert_to_unicode(ascii, header[0:start])
                    if value.strip():
                        decoded.append(value)
                    match.group('encoding').lower(),
                    match.group('encoded'))
                decoded.append(charsets.convert_to_unicode(charset, value))
                header = header[match.end():]
            else:
                # no match? append the remainder
                # of the string to the list of chunks
                decoded.append(charsets.convert_to_unicode(ascii, header))

src/f/l/flanker-HEAD/flanker/mime/message/headers/encodedword.py   flanker(Download)
                if start != 0:
                    # decodes unencoded ascii part to unicode
                    value = charsets.convert_to_unicode(ascii, header[0:start])
                    if value.strip():
                        decoded.append(value)
                    match.group('encoding').lower(),
                    match.group('encoded'))
                decoded.append(charsets.convert_to_unicode(charset, value))
                header = header[match.end():]
            else:
                # no match? append the remainder
                # of the string to the list of chunks
                decoded.append(charsets.convert_to_unicode(ascii, header))

src/f/l/flanker-0.4.14/flanker/mime/message/part.py   flanker(Download)
 
            # it should be stored as unicode. period
            self.body = charsets.convert_to_unicode(charset, body)
 
            # let's be simple when possible
 
    charset = ctype.get_charset()
    body = charsets.convert_to_unicode(charset, body)
 
    # for text/html unicode bodies make sure to replace

src/f/l/flanker-HEAD/flanker/mime/message/part.py   flanker(Download)
 
            # it should be stored as unicode. period
            self.body = charsets.convert_to_unicode(charset, body)
 
            # let's be simple when possible
 
    charset = ctype.get_charset()
    body = charsets.convert_to_unicode(charset, body)
 
    # for text/html unicode bodies make sure to replace

src/f/l/flanker-0.4.14/flanker/mime/message/headers/parametrized.py   flanker(Download)
    charset, language, val = parts
    val = urllib.unquote(val)
    return charsets.convert_to_unicode(charset, val)
 
 

src/f/l/flanker-0.4.14/flanker/mime/message/fallback/part.py   flanker(Download)
    def body(self):
        if not self.m.is_multipart():
            return charsets.convert_to_unicode(
                self.charset,
                self.m.get_payload(decode=True))

src/f/l/flanker-HEAD/flanker/mime/message/headers/parametrized.py   flanker(Download)
    charset, language, val = parts
    val = urllib.unquote(val)
    return charsets.convert_to_unicode(charset, val)
 
 

src/f/l/flanker-HEAD/flanker/mime/message/fallback/part.py   flanker(Download)
    def body(self):
        if not self.m.is_multipart():
            return charsets.convert_to_unicode(
                self.charset,
                self.m.get_payload(decode=True))

src/f/l/flanker-0.4.14/tests/mime/message/headers/encodedword_test.py   flanker(Download)
def test_convert_to_utf8_unknown_encoding():
    v = "abc\x80def"
    eq_(u"abc\u20acdef", charsets.convert_to_unicode("windows-874", v))
    eq_(u"qwe", charsets.convert_to_unicode('X-UNKNOWN', u"qwe"))
    eq_(u"qwe", charsets.convert_to_unicode('ru_RU.KOI8-R', 'qwe'))
    eq_(u"qwe", charsets.convert_to_unicode('"utf-8"; format="flowed"', 'qwe'))

src/f/l/flanker-HEAD/tests/mime/message/headers/encodedword_test.py   flanker(Download)
def test_convert_to_utf8_unknown_encoding():
    v = "abc\x80def"
    eq_(u"abc\u20acdef", charsets.convert_to_unicode("windows-874", v))
    eq_(u"qwe", charsets.convert_to_unicode('X-UNKNOWN', u"qwe"))
    eq_(u"qwe", charsets.convert_to_unicode('ru_RU.KOI8-R', 'qwe'))
    eq_(u"qwe", charsets.convert_to_unicode('"utf-8"; format="flowed"', 'qwe'))