96.6k views
3 votes
Let's assume we have a text that contains a Unicode character that cannot be displayed because our font has no corresponding glyph. Usually, a placeholder is displayed instead, e.g. a rectangular block thingy (see screenshot).

Is there a glyph not found character that reliably produces this glyph? I'd like to write something like If the following text contains then you need another font... in a UI.

By the way, I am not talking about � (replacement character). This one is displayed when a Unicode character could not be correctly decoded from a data stream. It does not necessarily produce the same glyph:

1 Answer

7 votes

Final answer:

The Missing Character Glyph (U+25A1) can be used as a placeholder for Unicode characters that cannot be displayed by a font, in situations where the font has no corresponding glyph. This is different from the Replacement Character (U+FFFD) which is used when a Unicode character cannot be correctly decoded from a data stream.

Step-by-step explanation:

In situations where a font cannot display a Unicode character, a placeholder glyph is typically used as a substitute. To reliably produce this glyph, the Unicode Standard provides a designated character called the 'Missing Character Glyph' (U+25A1) which represents a square with a question mark inside.

If you want to display a message like 'If the following text contains □, you need another font...' in a UI, you can use the Missing Character Glyph to represent the placeholder. It is important to note that this is different from the 'Replacement Character' (U+FFFD), which is used when a Unicode character could not be correctly decoded from a data stream.

User Adrya
by
7.9k points