Unicode: Character Property

By Xah Lee. Date: .

What is unicode character property

Each unicode character have properties.

A property is a pair, name and value.

For example, you have properties that tell you if a character is a letter, number, punctuation, symbol, separator, emoji, script (what language writting system), etc.

property names may have an abbreviation. For example the property name General_Category has an abbreviation of gc.

there are about 152 properties (not counting alias.)

Binary property

A binary property means the existance of the property is equivalent to it having a value of yes. if the property does not exist for a char, it is equivalent to it having a value of no.

For example, the property name emoji is a binary property.

Property General_Category

The most important property is the General_Category (abbreviated gc).

its value indicates the character's primary use.

value (grouped) value meaning examples
L Letter Alphabetic or ideographic characters
Lu Uppercase letter A, Ω
Ll Lowercase letter a, ω
Lt Titlecase letter Dž, Lj
Lm Modifier letter ʰ, ˈ
Lo Other letter 中, あ, ก
M Mark Combining characters
Mn Nonspacing mark ◌́ (acute)
Mc Spacing combining mark ◌া
Me Enclosing mark ◌⃝
N Number Numeric characters
Nd Decimal digit 0–9, ٠–٩
Nl Letter number Ⅰ, Ⅱ (Roman)
No Other number ½, ²
P Punctuation
Pc Connector _
Pd Dash -, –
Ps / Pe Open / Close (, )
Pi / Pf Initial / Final quote “, ”
Po Other !, ?
S Symbol
Sm Math +, =
Sc Currency $, €
Sk Modifier symbol ^, ˚
So Other symbol ©, ♥
Z Separator
Zs Space space, NBSP
Zl / Zp Line / Paragraph separator U+2028, U+2029
C Other
Cc Control NUL, ESC
Cf Format ZWJ, soft hyphen
Cs Surrogate (UTF-16 surrogates)
Co Private use
Cn Not assigned

There are also useful group aliases such as L (any letter), LC (cased letters), N (any number), etc.

Most important properties

Property Alias What it is
General_Category gc Primary classification (letter, number, punctuation, symbol, etc.)
Script sc Writing system (Latin, Cyrillic, Han, Arabic, etc.)
Uppercase / Lowercase — Binary case properties
White_Space — Space characters
Alphabetic — Letters + letter-like characters
Hex_Digit — a digit of hexadecimal
Emoji / Emoji_Presentation — Emoji-related binary properties
Extended_Pictographic — Broader emoji/pictograph set
Bidi_Class bc Bidirectional behavior (LTR, RTL, etc.)
Numeric_Value nv Numeric value of digits and number-like characters
Line_Break lb Line-breaking behavior
Word_Break wb Word boundary
Sentence_Break sb sentence boundary
Grapheme_Cluster_Break gcb User-perceived character boundaries
ID_Start / ID_Continue — Valid identifier characters
Canonical_Combining_Class ccc Combining character order
Age — Unicode version when the character was added
Name na Official character name