Python 字符串汉字区位码提取程序
s = input('输入字符串:')
for char in s:
if '一' <= char <= '鿿': # 判断是否为汉字
print(char + '=' + hex(ord(char))[2:], end=' ')
注意:此程序输出的是汉字的十六进制 Unicode 编码,不是区位码。
原文地址: https://www.cveoy.top/t/topic/nE6U 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
s = input('输入字符串:')
for char in s:
if '一' <= char <= '鿿': # 判断是否为汉字
print(char + '=' + hex(ord(char))[2:], end=' ')
注意:此程序输出的是汉字的十六进制 Unicode 编码,不是区位码。
原文地址: https://www.cveoy.top/t/topic/nE6U 著作权归作者所有。请勿转载和采集!