本文最后更新于 92 天前,其中的信息可能已经有所发展或是发生改变。
from unicodedata import lookup
from string import ascii_uppercase
with open("UnicodeData.txt", "r", encoding="utf-8") as f:
db = f.read().splitlines()
db = [i.split(";")[1] for i in db]
db = [i for i in db if i.split()[-1] in ascii_uppercase and len(i.split(" ")[-1]) == 1]
data = {}
for i in db:
category, letter = i.rsplit(" ", 1)
if category not in data:
data[category] = {}
try:
data[category][letter.lower()] = lookup(i)
except KeyError:
pass
data = {k: v for k, v in data.items() if len(v) == len(ascii_uppercase)}
for k, v in data.items():
test = "".join([v[i] for i in "print"]) + f"(end='')"
try:
eval(test)
except Exception as e:
continue
print(test[:5], k, end=" ")
for i in ["ascii", "utf-8", "latin"]:
try:
test.encode(i)
print(i, end=" ")
except Exception as e:
pass
print()
print LATIN SMALL LETTER ascii utf-8 latin
print FULLWIDTH LATIN SMALL LETTER utf-8
𝐩𝐫𝐢𝐧𝐭 MATHEMATICAL BOLD SMALL utf-8
𝒑𝒓𝒊𝒏𝒕 MATHEMATICAL BOLD ITALIC SMALL utf-8
𝓹𝓻𝓲𝓷𝓽 MATHEMATICAL BOLD SCRIPT SMALL utf-8
𝔭𝔯𝔦𝔫𝔱 MATHEMATICAL FRAKTUR SMALL utf-8
𝕡𝕣𝕚𝕟𝕥 MATHEMATICAL DOUBLE-STRUCK SMALL utf-8
𝖕𝖗𝖎𝖓𝖙 MATHEMATICAL BOLD FRAKTUR SMALL utf-8
𝗉𝗋𝗂𝗇𝗍 MATHEMATICAL SANS-SERIF SMALL utf-8
𝗽𝗿𝗶𝗻𝘁 MATHEMATICAL SANS-SERIF BOLD SMALL utf-8
𝘱𝘳𝘪𝘯𝘵 MATHEMATICAL SANS-SERIF ITALIC SMALL utf-8
𝙥𝙧𝙞𝙣𝙩 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL utf-8
𝚙𝚛𝚒𝚗𝚝 MATHEMATICAL MONOSPACE SMALL utf-8