How does one go from a Unicode character to its description?

喜你入骨 提交于 2019-12-31 03:48:09

问题


I came across this cute little symbol today:

🔮

I couldn't figure out what it was, so I searched for reverse lookup services and character maps that might be able to reveal a name to no avail. I know, however, that Windows' character map program knows the names of symbols:

How does Windows accomplish this? How might I, but a lowly programmer, divine this same knowledge? What encoding system does Unicode use to tie a symbol to its description?


回答1:


This information comes from the Unicode Character Database.

Specifically, the code points and their names (and other info like the category of a code point) are defined in UnicodeData.txt.

A lot of programming languages have this information in the standard library, eg. the unicodedata module of Python.




回答2:


If you just want to know the glyph name, head on over to CodePoints (or Graphemica or probably any one of a dozen other sites) and do a search on it. I'm not sure which lookup services you used "to no avail" but those two have no issues in locating it.

Doing so with 🔮 will lead you to codepoint U+1F52e, which will give you the descriptive name "CRYSTAL BALL", along with all sorts of other useful information about it.



来源:https://stackoverflow.com/questions/39360359/how-does-one-go-from-a-unicode-character-to-its-description

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!