返回十六進制數[2:]
def hex2unicode(十六進制數字字符串):
return '\\u' +十六進制數字字符串
def unicode 2中文(unicode_number):
if isinstance(unicode_number,str):
返回unicode _ number . encode(" Latin-1 ")。decode("unicode-escape ")
elif isinstance(unicode_number,bytes):
返回unicode _ number . decode(" unicode-escape ")
if __name__ == "__main__ ":
數量= 39532
hex_number_string = decimal2hex(數字)
unicode _ number = hex 2 unicode(hex _ number _ string)
中文= unicode 2中文(unicode_number)
印刷(中文)