def kuten_to_gb2312(kuten):
    """
    Convert GB kuten / quwei form (94 zones * 94 points) to GB2312-1980 /
    ISO-2022-CN hex (internal representation)
    """
    zone, point = int(kuten[:2]), int(kuten[2:])
    hi, lo = hexd(zone + 0x20), hexd(point + 0x20)

    gb2312 = "%s%s" % (hi, lo)

    assert isinstance(gb2312, bytes)
    return gb2312
def kuten_to_gb2312 ( kuten ) : zone , point = int ( kuten [ : 2 ] ) , int ( kuten [ 2 : ] ) hi , lo = hexd ( zone + 0x20 ) , hexd ( point + 0x20 ) gb2312 = "%s%s" % ( hi , lo ) assert isinstance ( gb2312 , bytes ) return gb2312
Convert GB kuten / quwei form (94 zones * 94 points) to GB2312-1980 /
    ISO-2022-CN hex (internal representation)