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


8.3 Bidi class

Every Unicode character or code point has a bidi class assigned to it. Before Unicode 4.0, this concept was known as bidirectional category.

The bidi class guides the bidirectional algorithm (https://www.unicode.org/reports/tr9/). The possible values are the following.

Constant: int UC_BIDI_L

The bidi class for ‘Left-to-Right‘” characters.

Constant: int UC_BIDI_LRE

The bidi class for “Left-to-Right Embedding” characters.

Constant: int UC_BIDI_LRO

The bidi class for “Left-to-Right Override” characters.

Constant: int UC_BIDI_R

The bidi class for “Right-to-Left” characters.

Constant: int UC_BIDI_AL

The bidi class for “Right-to-Left Arabic” characters.

Constant: int UC_BIDI_RLE

The bidi class for “Right-to-Left Embedding” characters.

Constant: int UC_BIDI_RLO

The bidi class for “Right-to-Left Override” characters.

Constant: int UC_BIDI_PDF

The bidi class for “Pop Directional Format” characters.

Constant: int UC_BIDI_EN

The bidi class for “European Number” characters.

Constant: int UC_BIDI_ES

The bidi class for “European Number Separator” characters.

Constant: int UC_BIDI_ET

The bidi class for “European Number Terminator” characters.

Constant: int UC_BIDI_AN

The bidi class for “Arabic Number” characters.

Constant: int UC_BIDI_CS

The bidi class for “Common Number Separator” characters.

Constant: int UC_BIDI_NSM

The bidi class for “Non-Spacing Mark” characters.

Constant: int UC_BIDI_BN

The bidi class for “Boundary Neutral” characters.

Constant: int UC_BIDI_B

The bidi class for “Paragraph Separator” characters.

Constant: int UC_BIDI_S

The bidi class for “Segment Separator” characters.

Constant: int UC_BIDI_WS

The bidi class for “Whitespace” characters.

Constant: int UC_BIDI_ON

The bidi class for “Other Neutral” characters.

Constant: int UC_BIDI_LRI

The bidi class for “Left-to-Right Isolate” characters.

Constant: int UC_BIDI_RLI

The bidi class for “Right-to-Left Isolate” characters.

Constant: int UC_BIDI_FSI

The bidi class for “First Strong Isolate” characters.

Constant: int UC_BIDI_PDI

The bidi class for “Pop Directional Isolate” characters.

The following functions implement the association between a bidirectional category and its name.

Function: const char * uc_bidi_class_name (int bidi_class)
Function: const char * uc_bidi_category_name (int category)

Returns the name of a bidi class, more precisely, the abbreviated name.

Function: const char * uc_bidi_class_long_name (int bidi_class)

Returns the long name of a bidi class.

Function: int uc_bidi_class_byname (const char *bidi_class_name)
Function: int uc_bidi_category_byname (const char *category_name)

Returns the bidi class given by name, e.g. "LRE", or by long name, e.g. "Left-to-Right Embedding". This lookup ignores spaces, underscores, or hyphens as word separators and is case-insignificant.

The following functions view bidirectional categories as sets of Unicode characters.

Function: int uc_bidi_class (ucs4_t uc)
Function: int uc_bidi_category (ucs4_t uc)

Returns the bidi class of a Unicode character.

Function: bool uc_is_bidi_class (ucs4_t uc, int bidi_class)
Function: bool uc_is_bidi_category (ucs4_t uc, int category)

Tests whether a Unicode character belongs to a given bidi class.


Next: Decimal digit value, Previous: Canonical combining class, Up: Unicode character classification and properties <unictype.h>   [Contents][Index]