简体   繁体   中英

Converting Unicode glyph to HTML

I'm looking to convert an outputted Unicode glyph (one that looks like an empty square in the source) to an html entity. This site does it: http://unicode.online-toolz.com/tools/unicode-html-entities-convertor.php

So  = 

Is there a function of combination of functions I can use to achieve this?

thanks

There are no “Unicode glyphs”. Unicode is a character standard, and glyphs are renderings of characters in fonts. The Unicode standard shows representative glyphs for characters, but they are just examples, not part of the standard.

Your example shows, or tries to show, U+E110, which is a Private Use code point . This means that the Unicode standard does not allocate any character to it and guarantees that it will never do that. Consequently, the code point is free for use between interested parties by private agreements for whatever purpose they like. Different parties may It has absolutely no meaning outside such agreements. The code point can be represented using a reference like  , but this does not change its meaning a bit.

In practice, Private Use code points are often used in fontistic tricks. On web page, they are especially used some implementations of “icon fonts”, where icons—which may not exist as characters at all—are allocated to such positions.

Thus, you need to find out what the code point is meant to stand for and then decide to try to find that character in its real Unicode position, or a sufficiently similar character, or use an image instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM