Back to index

python3.2  3.2.2
Classes | Functions | Variables
test.test_multibytecodec_support Namespace Reference

Classes

class  TestBase
class  TestBase_Mapping

Functions

def chr
def ord
def load_teststring

Variables

 _unichr = chr
 _ord = ord

Function Documentation

Definition at line 269 of file test_multibytecodec_support.py.

00269 
00270     def chr(v):
00271         if v >= 0x10000:
00272             return _unichr(0xd800 + ((v - 0x10000) >> 10)) + \
00273                    _unichr(0xdc00 + ((v - 0x10000) & 0x3ff))
00274         else:
            return _unichr(v)

Definition at line 381 of file test_multibytecodec_support.py.

00381 
00382 def load_teststring(name):
00383     dir = os.path.join(os.path.dirname(__file__), 'cjkencodings')
00384     with open(os.path.join(dir, name + '.txt'), 'rb') as f:
00385         encoded = f.read()
00386     with open(os.path.join(dir, name + '-utf8.txt'), 'rb') as f:
00387         utf8 = f.read()
00388     return encoded, utf8

Definition at line 276 of file test_multibytecodec_support.py.

00276 
00277     def ord(c):
00278         if len(c) == 2:
00279             return 0x10000 + ((_ord(c[0]) - 0xd800) << 10) + \
00280                           (ord(c[1]) - 0xdc00)
00281         else:
00282             return _ord(c)


Variable Documentation

Definition at line 275 of file test_multibytecodec_support.py.

Definition at line 268 of file test_multibytecodec_support.py.