1# -*- coding: latin-1 -*- 2 3__doc__ = br""" 4 >>> sa 5 'abc' 6 >>> ua 7 u'abc' 8 >>> b 9 u'123' 10 >>> c 11 u'S\xf8k ik' 12 >>> d 13 u'\xfc\xd6\xe4' 14 >>> e 15 u'\x03g\xf8\uf8d2S\xf8k ik' 16 >>> f 17 u'\xf8' 18 >>> add 19 u'S\xf8k ik\xfc\xd6\xe4abc' 20 >>> null 21 u'\x00' 22""".decode("ASCII") + b""" 23 >>> len(sa) 24 3 25 >>> len(ua) 26 3 27 >>> len(b) 28 3 29 >>> len(c) 30 6 31 >>> len(d) 32 3 33 >>> len(e) 34 10 35 >>> len(f) 36 1 37 >>> len(add) 38 12 39 >>> len(null) 40 1 41""".decode("ASCII") + u""" 42 >>> ua == u'abc' 43 True 44 >>> b == u'123' 45 True 46 >>> c == u'S�k ik' 47 True 48 >>> d == u'���' 49 True 50 >>> e == u'\x03\x67\xf8\uf8d2S�k ik' # unescaped by Cython 51 True 52 >>> e == u'\\x03\\x67\\xf8\\uf8d2S�k ik' # unescaped by Python 53 True 54 >>> f == u'\xf8' # unescaped by Cython 55 True 56 >>> f == u'\\xf8' # unescaped by Python 57 True 58 >>> k == u'�' == u'\\N{LATIN SMALL LETTER A WITH DIAERESIS}' 59 True 60 >>> add == u'S�k ik' + u'���' + 'abc' 61 True 62 >>> null == u'\\x00' # unescaped by Python (required by doctest) 63 True 64""" 65 66import sys 67if sys.version_info[0] >= 3: 68 __doc__ = __doc__.replace(u" u'", u" '") 69else: 70 __doc__ = __doc__.replace(u" b'", u" '") 71 72sa = 'abc' 73ua = u'abc' 74 75b = u'123' 76c = u'S�k ik' 77d = u'���' 78e = u'\x03\x67\xf8\uf8d2S�k ik' 79f = u'\xf8' 80k = u'\N{LATIN SMALL LETTER A WITH DIAERESIS}' 81 82add = u'S�k ik' + u'���' + u'abc' 83null = u'\x00' 84