unicode-name.md
October 10, 2024 · View on GitHub
Functions
- unicodeBaseName(char) ⇒
string|undefined Returns the name that has been assigned to a Unicode codepoint.
Please note: Some common codepoints do not have a name (e.g. C0 control characters like \n)
Also see:
- unicodeCorrectName(char) - Checks if there is a corrected name first, if not, fallbacks to this method
- unicodeReadableName(char) - Displays correct name or an applicable alias
- unicodeCorrectName(char) ⇒
string|undefined Returns the name that has been assigned to a Unicode codepoint, but if the codepoint has a correction alias, use this instead.
Please note: Some common codepoints do not have a name (e.g. C0 control characters like \n)
Also see:
- unicodeReadableName(char) - Displays correct name or an applicable alias
- unicodeAliases(char) ⇒
string|undefined Returns the aliases that have been assigned to a Unicode codepoint.
Aliases can be of these categories (multiple aliases possible):
- correction
- control
- figment
- alternate
- abbreviation
- unicodeType(char) ⇒
string|undefined Determine the basic type of codepoints. Required to be able to get the Unicode label of a codepoint. This can be one of:
- Graphic
- Format
- Control
- Private-use
- Surrogate
- Noncharacter
- Reserved
- unicodeLabel(char) ⇒
string|undefined Returns a label of a codepoint in the following format:
, e.g. for the tab character or for U+FFFFF It is only assigned to codepoints of a type other than "Graphic" or "Format"
- unicodeReadableName(char) ⇒
string|undefined Returns the best readable representation of a codepoint.
- It is the corrected name of a the codepoint (if one exists)
- or it is an appropriate aliase (if one exists)
- or it is the codepoint label
- unicodeSequenceName(char) ⇒
string|undefined Returns the name of a character that is made of a codepoint sequence (= more than one codepoint involved), if one exists.
- unicodeQualifiedSequenceName(char) ⇒
string|undefined Returns the name of a character that is made of a codepoint sequence (= more than one codepoint involved), if one exists.
Differently from unicodeSequenceName(char), it will only consider Emoji ZWJ sequences that are fully qualified, meaning they all required variation selectors (VS16) in place
- unicodeName(char) ⇒
string|undefined Returns the best name for the Unicode character (codepoint or codepoint sequence).
At first, it will check if the codepoint sequence has a name, e.g. for Emoji that are build up using multiple codepoints using unicodeSequenceName(char)
If none is found, will use the unicodeReadableName(char) function to retrieve the best name for that codepoint.
unicodeBaseName(char) ⇒ string | undefined
Returns the name that has been assigned to a Unicode codepoint.
Please note: Some common codepoints do not have a name (e.g. C0 control characters like \n)
Also see:
- unicodeCorrectName(char) - Checks if there is a corrected name first, if not, fallbacks to this method
- unicodeReadableName(char) - Displays correct name or an applicable alias
Kind: global function
Returns: string | undefined - Name of character or undefined
| Param | Type | Description |
|---|---|---|
| char | string | number | Single character string or codepoint |
unicodeCorrectName(char) ⇒ string | undefined
Returns the name that has been assigned to a Unicode codepoint, but if the codepoint has a correction alias, use this instead.
Please note: Some common codepoints do not have a name (e.g. C0 control characters like \n)
Also see:
- unicodeReadableName(char) - Displays correct name or an applicable alias
Kind: global function
Returns: string | undefined - Corrected name of character or undefined
| Param | Type | Description |
|---|---|---|
| char | string | number | Single character string or codepoint |
unicodeAliases(char) ⇒ string | undefined
Returns the aliases that have been assigned to a Unicode codepoint.
Aliases can be of these categories (multiple aliases possible):
- correction
- control
- figment
- alternate
- abbreviation
Kind: global function
Returns: string | undefined - Object containing aliases for this Unicode codepoint
| Param | Type | Description |
|---|---|---|
| char | string | number | Single character string or codepoint |
unicodeType(char) ⇒ string | undefined
Determine the basic type of codepoints. Required to be able to get the Unicode label of a codepoint. This can be one of:
- Graphic
- Format
- Control
- Private-use
- Surrogate
- Noncharacter
- Reserved
Kind: global function
Returns: string | undefined - Codepoint type
| Param | Type | Description |
|---|---|---|
| char | string | number | Single character string or codepoint |
unicodeLabel(char) ⇒ string | undefined
Returns a label of a codepoint in the following format:
It is only assigned to codepoints of a type other than "Graphic" or "Format"
Kind: global function
Returns: string | undefined - A generic label for this codepoint
| Param | Type | Description |
|---|---|---|
| char | string | number | Single character string or codepoint |
unicodeReadableName(char) ⇒ string | undefined
Returns the best readable representation of a codepoint.
- It is the corrected name of a the codepoint (if one exists)
- or it is an appropriate aliase (if one exists)
- or it is the codepoint label
Kind: global function
Returns: string | undefined - Unicode name, alias, or label for this character
| Param | Type | Description |
|---|---|---|
| char | string | number | Single character string or codepoint |
unicodeSequenceName(char) ⇒ string | undefined
Returns the name of a character that is made of a codepoint sequence (= more than one codepoint involved), if one exists.
Kind: global function
Returns: string | undefined - Unicode sequence name
| Param | Type | Description |
|---|---|---|
| char | string | Single character string made of multiple codepoints |
unicodeQualifiedSequenceName(char) ⇒ string | undefined
Returns the name of a character that is made of a codepoint sequence (= more than one codepoint involved), if one exists.
Differently from unicodeSequenceName(char), it will only consider Emoji ZWJ sequences that are fully qualified, meaning they all required variation selectors (VS16) in place
Kind: global function
Returns: string | undefined - Unicode sequence name
| Param | Type | Description |
|---|---|---|
| char | string | Single character string made of multiple codepoints |
unicodeName(char) ⇒ string | undefined
Returns the best name for the Unicode character (codepoint or codepoint sequence).
At first, it will check if the codepoint sequence has a name, e.g. for Emoji that are build up using multiple codepoints using unicodeSequenceName(char)
If none is found, will use the unicodeReadableName(char) function to retrieve the best name for that codepoint.
Kind: global function
Returns: string | undefined - Name of character
| Param | Type | Description |
|---|---|---|
| char | string | number | Single character string or codepoint |