Next: , Previous: , Up: Unicode character classification and properties <unictype.h>   [Contents][Index]


8.7 Mirrored character

Character mirroring is used to associate the closing parenthesis character to the opening parenthesis character, the closing brace character with the opening brace character, and so on.

The following function looks up the mirrored character of a Unicode character.

Function: bool uc_mirror_char (ucs4_t uc, ucs4_t *puc)

Stores the mirrored character of a Unicode character uc in *puc and returns true, if it exists. Otherwise it stores uc unmodified in *puc and returns false.

Note: It is possible for this function to return true and set *puc to 0xFFFD. This happens when the character has the bidi mirror property (that is, it should be displayed through a mirrored glyph) but this mirrored glyph does not exist as a Unicode character; thus a rendering engine needs to synthesize it artificially or pick it from an appropriate font. This affects mostly mathematical operators. See section “Bidi Mirrored” of the Unicode standard.