Enum Class NumberingSystem
- All Implemented Interfaces:
Serializable,Comparable<NumberingSystem>,Constable
I18n.numberingSystem() and applied at format time through
I18n.localizeDigits(java.lang.String); nothing at the shaping or drawing layer knows this type exists.
The table below is CLDR's, checked against it.
scripts/i18n/dump-cldr-locale-facts.mjs reads Node's Intl.NumberFormat, which
is CLDR through ICU, and CldrLocaleFactsTest holds forLocale(java.util.Locale) to the dump.
That check found the first hand-written table inverted where it mattered most: it answered
ARAB for plain ar and treated the Maghreb as the exception, where CLDR makes
Latin the Arabic default and names twenty-three regions that write Arabic-Indic digits.
A reader in Dubai or Casablanca was shown digits no application beside ours uses. Being CLDR's
data, the table is under the Unicode License v3, whose text the toolkit's jar carries at
limn/i18n/internal/CLDR-LICENSE.txt.
Seven systems CLDR names for a language are deliberately absent, and a locale that
wants one gets LATN until they are added: Bengali (as, bn,
mni), Burmese (my), Tibetan (dz), Chakma (ccp), N'Ko
(nqo), Ol Chiki (sat) and Adlam (Fulah written in it, ff-Adlm). Each is
a constant and a table row away, and what gates them is not this class but the glyph coverage
test — a numbering system whose digits the vendored fonts cannot draw is worse than Latin ones.
CldrLocaleFactsTest names them as known gaps rather than letting them read as
oversights.
DEVA is chosen automatically, for the languages CLDR gives it to — Marathi,
Nepali, Sanskrit, Bhojpuri, Haryanvi and Rajasthani — and not for Hindi, which CLDR writes in
Latin digits. Until 2026-09-21 it was reachable only through I18n.setNumberingSystem(limn.i18n.NumberingSystem),
on the belief that no language defaulted to it.
A 1.x minor release may add constants to this enum: a switch over it needs a
default branch.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionArabic-Indic٠–٩(U+0660–0669): Arabic in the twenty-three regions below, Najdi Arabic, Central Kurdish, and Sindhi in Arabic script, which is Sindhi everywhere but India.Extended Arabic-Indic۰–۹(U+06F0–06F9): Persian, Pashto, Mazanderani, Northern Luri, Kashmiri except in Devanagari, Punjabi and Uzbek in Arabic script, and Urdu in India.Devanagari०–९(U+0966–096F): Marathi, Nepali, Sanskrit, Bhojpuri, Haryanvi, Rajasthani — and never Hindi.ASCII0–9: the default, and the system every parse normalizes to. -
Method Summary
Modifier and TypeMethodDescriptionchardigit(int value) The digitvalue(0–9) is written as in this system.static intdigitValue(int codepoint) The numeric value ofcodepointin any system this enum knows, or-1.static NumberingSystemCLDR's default system forlocale, over the systems this enum carries.static NumberingSystemReturns the enum constant of this class with the specified name.static NumberingSystem[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LATN
ASCII0–9: the default, and the system every parse normalizes to. -
ARAB
Arabic-Indic٠–٩(U+0660–0669): Arabic in the twenty-three regions below, Najdi Arabic, Central Kurdish, and Sindhi in Arabic script, which is Sindhi everywhere but India. -
ARABEXT
Extended Arabic-Indic۰–۹(U+06F0–06F9): Persian, Pashto, Mazanderani, Northern Luri, Kashmiri except in Devanagari, Punjabi and Uzbek in Arabic script, and Urdu in India. -
DEVA
Devanagari०–९(U+0966–096F): Marathi, Nepali, Sanskrit, Bhojpuri, Haryanvi, Rajasthani — and never Hindi.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
digit
public char digit(int value) The digitvalue(0–9) is written as in this system. -
digitValue
public static int digitValue(int codepoint) The numeric value ofcodepointin any system this enum knows, or-1. Deliberately not restricted to one system: a parse that folded only the active system's digits would reject a pasted value the moment the locale changed under it. -
forLocale
CLDR's default system forlocale, over the systems this enum carries.Every branch is a row of
cldr-locale-facts.txtand none of it is reasoned from the shape of a language: Sindhi writes Arabic-Indic digits at home and Latin ones in India, Punjabi writes Latin digits except in Pakistan, and Urdu writes Latin digits except in India, which no rule about scripts would predict. What CLDR writes in Bengali, Burmese, Tibetan, Chakma, N'Ko, Ol Chiki or Adlam digits answersLATN, since this enum does not carry those systems; the class note says why.A script the locale names decides before its region does, where CLDR holds the language in that script, because a region stands for the script the language is written in there and a named script says so outright: Punjabi in Pakistan is Punjabi in Arabic script, and Punjabi in Gurmukhi writes Latin digits in Pakistan too. So Sindhi in Devanagari writes Latin digits and Sindhi in Arabic script Arabic-Indic ones even in India, Kashmiri in Devanagari writes Latin digits, Punjabi and Uzbek in Arabic script write Extended Arabic-Indic digits in every region, and Uzbek in Latin or Cyrillic keeps Latin ones in Afghanistan. A script CLDR does not hold the language in, Arabic in Latin script say, is read as no script at all, and the language and its region decide.
A code ICU reads as another language is read as that language before anything is decided, as ICU reads it before it looks anything up:
pes, the ISO 639-3 code for Iranian Persian, writes whatfawrites, andarb-EG, Standard Arabic in Egypt, whatar-EGwrites.Localereplaces onlyiw,jiandinon its own. A replacement that carries a region or a script fills in only what the locale leaves out:prs, Dari, isfa-AF, andprs-IRisfa-IR. The codes are every one ICU replaces, the same ones the plural rules, the string bundles and the calendars read a locale through. A region named by its UN number is read the same way, as the region it stands for:ar-818writes whatar-EGwrites, and so is a retired one:ar-YD, South Yemen, writes whatar-YEwrites.A locale that names its digits decides first: the Unicode extension
-u-nu-, as a user's system settings write a choice of digits that is not the language's default, soar-EG-u-nu-latnwrites Latin digits anden-u-nu-arabArabic-Indic ones. A system the extension names and this enum does not carry is read as no extension at all.- Parameters:
locale- the locale to classify- Returns:
- the system the locale names, else the one CLDR gives it, else
LATN
-