#include "config.h"
#include "IntlObject.h"
#if ENABLE(INTL)
#include "Error.h"
#include "FunctionPrototype.h"
#include "IntlCollator.h"
#include "IntlCollatorConstructor.h"
#include "IntlCollatorPrototype.h"
#include "IntlDateTimeFormat.h"
#include "IntlDateTimeFormatConstructor.h"
#include "IntlDateTimeFormatPrototype.h"
#include "IntlNumberFormat.h"
#include "IntlNumberFormatConstructor.h"
#include "IntlNumberFormatPrototype.h"
#include "JSCInlines.h"
#include "JSCJSValueInlines.h"
#include "Lookup.h"
#include "ObjectPrototype.h"
#include <unicode/uloc.h>
#include <unicode/unumsys.h>
#include <wtf/Assertions.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/PlatformUserPreferredLanguages.h>
namespace JSC {
STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(IntlObject);
}
namespace JSC {
struct MatcherResult {
String locale;
String extension;
size_t extensionIndex;
};
const ClassInfo IntlObject::s_info = { "Object", &Base::s_info, 0, CREATE_METHOD_TABLE(IntlObject) };
IntlObject::IntlObject(VM& vm, Structure* structure)
: JSNonFinalObject(vm, structure)
{
}
IntlObject* IntlObject::create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
{
IntlObject* object = new (NotNull, allocateCell<IntlObject>(vm.heap)) IntlObject(vm, structure);
object->finishCreation(vm, globalObject);
return object;
}
void IntlObject::finishCreation(VM& vm, JSGlobalObject* globalObject)
{
Base::finishCreation(vm);
ASSERT(inherits(info()));
IntlCollatorPrototype* collatorPrototype = IntlCollatorPrototype::create(vm, globalObject, IntlCollatorPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
Structure* collatorStructure = IntlCollator::createStructure(vm, globalObject, collatorPrototype);
IntlCollatorConstructor* collatorConstructor = IntlCollatorConstructor::create(vm, IntlCollatorConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), collatorPrototype, collatorStructure);
collatorPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, collatorConstructor, DontEnum);
IntlNumberFormatPrototype* numberFormatPrototype = IntlNumberFormatPrototype::create(vm, globalObject, IntlNumberFormatPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
Structure* numberFormatStructure = IntlNumberFormat::createStructure(vm, globalObject, numberFormatPrototype);
IntlNumberFormatConstructor* numberFormatConstructor = IntlNumberFormatConstructor::create(vm, IntlNumberFormatConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), numberFormatPrototype, numberFormatStructure);
numberFormatPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, numberFormatConstructor, DontEnum);
IntlDateTimeFormatPrototype* dateTimeFormatPrototype = IntlDateTimeFormatPrototype::create(vm, globalObject, IntlDateTimeFormatPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
Structure* dateTimeFormatStructure = IntlDateTimeFormat::createStructure(vm, globalObject, dateTimeFormatPrototype);
IntlDateTimeFormatConstructor* dateTimeFormatConstructor = IntlDateTimeFormatConstructor::create(vm, IntlDateTimeFormatConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), dateTimeFormatPrototype, dateTimeFormatStructure);
dateTimeFormatPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, dateTimeFormatConstructor, DontEnum);
putDirectWithoutTransition(vm, vm.propertyNames->Collator, collatorConstructor, DontEnum);
putDirectWithoutTransition(vm, vm.propertyNames->NumberFormat, numberFormatConstructor, DontEnum);
putDirectWithoutTransition(vm, vm.propertyNames->DateTimeFormat, dateTimeFormatConstructor, DontEnum);
}
Structure* IntlObject::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
{
return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
}
void convertICULocaleToBCP47LanguageTag(String& locale)
{
locale.replace('_', '-');
}
bool intlBooleanOption(ExecState& state, JSValue options, PropertyName property, bool& usesFallback)
{
JSObject* opts = options.toObject(&state);
if (state.hadException())
return false;
JSValue value = opts->get(&state, property);
if (state.hadException())
return false;
if (!value.isUndefined()) {
bool booleanValue = value.toBoolean(&state);
usesFallback = false;
return booleanValue;
}
usesFallback = true;
return false;
}
String intlStringOption(ExecState& state, JSValue options, PropertyName property, std::initializer_list<const char*> values, const char* notFound, const char* fallback)
{
JSObject* opts = options.toObject(&state);
if (state.hadException())
return { };
JSValue value = opts->get(&state, property);
if (state.hadException())
return { };
if (!value.isUndefined()) {
String stringValue = value.toWTFString(&state);
if (state.hadException())
return { };
if (values.size() && std::find(values.begin(), values.end(), stringValue) == values.end()) {
state.vm().throwException(&state, createRangeError(&state, notFound));
return { };
}
return stringValue;
}
return fallback;
}
unsigned intlNumberOption(ExecState& state, JSValue options, PropertyName property, unsigned minimum, unsigned maximum, unsigned fallback)
{
JSObject* opts = options.toObject(&state);
if (state.hadException())
return 0;
JSValue value = opts->get(&state, property);
if (state.hadException())
return 0;
if (!value.isUndefined()) {
double doubleValue = value.toNumber(&state);
if (state.hadException())
return 0;
if (!(doubleValue >= minimum && doubleValue <= maximum)) {
state.vm().throwException(&state, createRangeError(&state, *property.publicName() + " is out of range"));
return 0;
}
return static_cast<unsigned>(doubleValue);
}
return fallback;
}
static String privateUseLangTag(const Vector<String>& parts, size_t startIndex)
{
size_t numParts = parts.size();
size_t currentIndex = startIndex;
StringBuilder privateuse;
while (currentIndex < numParts) {
const String& singleton = parts[currentIndex];
unsigned singletonLength = singleton.length();
bool isValid = (singletonLength == 1 && (singleton == "x" || singleton == "X"));
if (!isValid)
break;
if (currentIndex != startIndex)
privateuse.append('-');
++currentIndex;
unsigned numExtParts = 0;
privateuse.append('x');
while (currentIndex < numParts) {
const String& extPart = parts[currentIndex];
unsigned extPartLength = extPart.length();
bool isValid = (extPartLength >= 2 && extPartLength <= 8 && extPart.isAllSpecialCharacters<isASCIIAlphanumeric>());
if (!isValid)
break;
++currentIndex;
++numExtParts;
privateuse.append('-');
privateuse.append(extPart.convertToASCIILowercase());
}
if (!numExtParts)
return String();
}
if (currentIndex < numParts)
return String();
return privateuse.toString();
}
static String canonicalLangTag(const Vector<String>& parts)
{
ASSERT(!parts.isEmpty());
size_t numParts = parts.size();
size_t currentIndex = 0;
const String& language = parts[currentIndex];
unsigned languageLength = language.length();
bool canHaveExtlang = languageLength >= 2 && languageLength <= 3;
bool isValidLanguage = languageLength >= 2 && languageLength <= 8 && language.isAllSpecialCharacters<isASCIIAlpha>();
if (!isValidLanguage)
return String();
++currentIndex;
StringBuilder canonical;
canonical.append(language.convertToASCIILowercase());
if (canHaveExtlang) {
for (unsigned times = 0; times < 3 && currentIndex < numParts; ++times) {
const String& extlang = parts[currentIndex];
unsigned extlangLength = extlang.length();
if (extlangLength == 3 && extlang.isAllSpecialCharacters<isASCIIAlpha>()) {
++currentIndex;
canonical.append('-');
canonical.append(extlang.convertToASCIILowercase());
} else
break;
}
}
if (currentIndex < numParts) {
const String& script = parts[currentIndex];
unsigned scriptLength = script.length();
if (scriptLength == 4 && script.isAllSpecialCharacters<isASCIIAlpha>()) {
++currentIndex;
canonical.append('-');
canonical.append(toASCIIUpper(script[0]));
canonical.append(script.substring(1, 3).convertToASCIILowercase());
}
}
if (currentIndex < numParts) {
const String& region = parts[currentIndex];
unsigned regionLength = region.length();
bool isValidRegion = (
(regionLength == 2 && region.isAllSpecialCharacters<isASCIIAlpha>())
|| (regionLength == 3 && region.isAllSpecialCharacters<isASCIIDigit>())
);
if (isValidRegion) {
++currentIndex;
canonical.append('-');
canonical.append(region.convertToASCIIUppercase());
}
}
HashSet<String> subtags;
while (currentIndex < numParts) {
const String& variant = parts[currentIndex];
unsigned variantLength = variant.length();
bool isValidVariant = (
(variantLength >= 5 && variantLength <= 8 && variant.isAllSpecialCharacters<isASCIIAlphanumeric>())
|| (variantLength == 4 && isASCIIDigit(variant[0]) && variant.substring(1, 3).isAllSpecialCharacters<isASCIIAlphanumeric>())
);
if (!isValidVariant)
break;
String lowerVariant = variant.convertToASCIILowercase();
if (!subtags.add(lowerVariant).isNewEntry)
return String();
++currentIndex;
canonical.append('-');
canonical.append(lowerVariant);
}
subtags.clear();
Vector<String> extensions;
while (currentIndex < numParts) {
const String& possibleSingleton = parts[currentIndex];
unsigned singletonLength = possibleSingleton.length();
bool isValidSingleton = (singletonLength == 1 && possibleSingleton != "x" && possibleSingleton != "X" && isASCIIAlphanumeric(possibleSingleton[0]));
if (!isValidSingleton)
break;
String singleton = possibleSingleton.convertToASCIILowercase();
if (!subtags.add(singleton).isNewEntry)
return String();
++currentIndex;
int numExtParts = 0;
StringBuilder extension;
extension.append(singleton);
while (currentIndex < numParts) {
const String& extPart = parts[currentIndex];
unsigned extPartLength = extPart.length();
bool isValid = (extPartLength >= 2 && extPartLength <= 8 && extPart.isAllSpecialCharacters<isASCIIAlphanumeric>());
if (!isValid)
break;
++currentIndex;
++numExtParts;
extension.append('-');
extension.append(extPart.convertToASCIILowercase());
}
if (!numExtParts)
return String();
extensions.append(extension.toString());
}
std::sort(
extensions.begin(),
extensions.end(),
[] (const String& a, const String& b) -> bool {
return a[0] < b[0];
}
);
size_t numExtenstions = extensions.size();
for (size_t i = 0; i < numExtenstions; ++i) {
canonical.append('-');
canonical.append(extensions[i]);
}
if (currentIndex < numParts) {
String privateuse = privateUseLangTag(parts, currentIndex);
if (privateuse.isNull())
return String();
canonical.append('-');
canonical.append(privateuse);
}
return canonical.toString();
}
static String grandfatheredLangTag(const String& locale)
{
HashMap<String, String> tagMap = {
{ ASCIILiteral("en-gb-oed"), ASCIILiteral("en-GB-oed") },
{ ASCIILiteral("i-ami"), ASCIILiteral("ami") },
{ ASCIILiteral("i-bnn"), ASCIILiteral("bnn") },
{ ASCIILiteral("i-default"), ASCIILiteral("i-default") },
{ ASCIILiteral("i-enochian"), ASCIILiteral("i-enochian") },
{ ASCIILiteral("i-hak"), ASCIILiteral("hak") },
{ ASCIILiteral("i-klingon"), ASCIILiteral("tlh") },
{ ASCIILiteral("i-lux"), ASCIILiteral("lb") },
{ ASCIILiteral("i-mingo"), ASCIILiteral("i-mingo") },
{ ASCIILiteral("i-navajo"), ASCIILiteral("nv") },
{ ASCIILiteral("i-pwn"), ASCIILiteral("pwn") },
{ ASCIILiteral("i-tao"), ASCIILiteral("tao") },
{ ASCIILiteral("i-tay"), ASCIILiteral("tay") },
{ ASCIILiteral("i-tsu"), ASCIILiteral("tsu") },
{ ASCIILiteral("sgn-be-fr"), ASCIILiteral("sfb") },
{ ASCIILiteral("sgn-be-nl"), ASCIILiteral("vgt") },
{ ASCIILiteral("sgn-ch-de"), ASCIILiteral("sgg") },
{ ASCIILiteral("art-lojban"), ASCIILiteral("jbo") },
{ ASCIILiteral("cel-gaulish"), ASCIILiteral("cel-gaulish") },
{ ASCIILiteral("no-bok"), ASCIILiteral("nb") },
{ ASCIILiteral("no-nyn"), ASCIILiteral("nn") },
{ ASCIILiteral("zh-guoyu"), ASCIILiteral("cmn") },
{ ASCIILiteral("zh-hakka"), ASCIILiteral("hak") },
{ ASCIILiteral("zh-min"), ASCIILiteral("zh-min") },
{ ASCIILiteral("zh-min-nan"), ASCIILiteral("nan") },
{ ASCIILiteral("zh-xiang"), ASCIILiteral("hsn") }
};
return tagMap.get(locale.convertToASCIILowercase());
}
static String canonicalizeLanguageTag(const String& locale)
{
String grandfather = grandfatheredLangTag(locale);
if (!grandfather.isNull())
return grandfather;
Vector<String> parts;
locale.split('-', true, parts);
if (!parts.isEmpty()) {
String langtag = canonicalLangTag(parts);
if (!langtag.isNull())
return langtag;
String privateuse = privateUseLangTag(parts, 0);
if (!privateuse.isNull())
return privateuse;
}
return String();
}
Vector<String> canonicalizeLocaleList(ExecState& state, JSValue locales)
{
VM& vm = state.vm();
JSGlobalObject* globalObject = state.callee()->globalObject();
Vector<String> seen;
if (locales.isUndefined())
return seen;
JSObject* localesObject;
if (locales.isString()) {
JSArray* localesArray = JSArray::tryCreateUninitialized(vm, globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithContiguous), 1);
localesArray->initializeIndex(vm, 0, locales);
localesObject = localesArray;
} else {
localesObject = locales.toObject(&state);
}
if (state.hadException())
return Vector<String>();
JSValue lengthProperty = localesObject->get(&state, vm.propertyNames->length);
if (state.hadException())
return Vector<String>();
double length = lengthProperty.toLength(&state);
if (state.hadException())
return Vector<String>();
HashSet<String> seenSet;
for (double k = 0; k < length; ++k) {
bool kPresent = localesObject->hasProperty(&state, k);
if (state.hadException())
return Vector<String>();
if (kPresent) {
JSValue kValue = localesObject->get(&state, k);
if (state.hadException())
return Vector<String>();
if (!kValue.isString() && !kValue.isObject()) {
throwTypeError(&state, ASCIILiteral("locale value must be a string or object"));
return Vector<String>();
}
JSString* tag = kValue.toString(&state);
if (state.hadException())
return Vector<String>();
String canonicalizedTag = canonicalizeLanguageTag(tag->value(&state));
if (canonicalizedTag.isNull()) {
state.vm().throwException(&state, createRangeError(&state, String::format("invalid language tag: %s", tag->value(&state).utf8().data())));
return Vector<String>();
}
if (seenSet.add(canonicalizedTag).isNewEntry)
seen.append(canonicalizedTag);
}
}
return seen;
}
String bestAvailableLocale(const HashSet<String>& availableLocales, const String& locale)
{
String candidate = locale;
while (!candidate.isEmpty()) {
if (availableLocales.contains(candidate))
return candidate;
size_t pos = candidate.reverseFind('-');
if (pos == notFound)
return String();
if (pos >= 2 && candidate[pos - 2] == '-')
pos -= 2;
candidate = candidate.substring(0, pos);
}
return String();
}
String defaultLocale(ExecState& state)
{
if (auto defaultLanguage = state.callee()->globalObject()->globalObjectMethodTable()->defaultLanguage) {
String locale = defaultLanguage();
if (!locale.isEmpty())
return canonicalizeLanguageTag(locale);
}
Vector<String> languages = platformUserPreferredLanguages();
if (!languages.isEmpty() && !languages[0].isEmpty())
return canonicalizeLanguageTag(languages[0]);
String locale = uloc_getDefault();
convertICULocaleToBCP47LanguageTag(locale);
return locale;
}
String removeUnicodeLocaleExtension(const String& locale)
{
Vector<String> parts;
locale.split('-', parts);
StringBuilder builder;
size_t partsSize = parts.size();
if (partsSize > 0)
builder.append(parts[0]);
for (size_t p = 1; p < partsSize; ++p) {
if (parts[p] == "u") {
while (p + 1 < partsSize && parts[p + 1].length() > 1)
++p;
} else {
builder.append('-');
builder.append(parts[p]);
}
}
return builder.toString();
}
static MatcherResult lookupMatcher(ExecState& state, const HashSet<String>& availableLocales, const Vector<String>& requestedLocales)
{
String locale;
String noExtensionsLocale;
String availableLocale;
for (size_t i = 0; i < requestedLocales.size() && availableLocale.isNull(); ++i) {
locale = requestedLocales[i];
noExtensionsLocale = removeUnicodeLocaleExtension(locale);
availableLocale = bestAvailableLocale(availableLocales, noExtensionsLocale);
}
MatcherResult result;
if (!availableLocale.isNull()) {
result.locale = availableLocale;
if (locale != noExtensionsLocale) {
size_t extensionIndex = locale.find("-u-");
RELEASE_ASSERT(extensionIndex != notFound);
size_t extensionLength = locale.length() - extensionIndex;
size_t end = extensionIndex + 3;
while (end < locale.length()) {
end = locale.find('-', end);
if (end == notFound)
break;
if (end + 2 < locale.length() && locale[end + 2] == '-') {
extensionLength = end - extensionIndex;
break;
}
end++;
}
result.extension = locale.substring(extensionIndex, extensionLength);
result.extensionIndex = extensionIndex;
}
} else
result.locale = defaultLocale(state);
return result;
}
static MatcherResult bestFitMatcher(ExecState& state, const HashSet<String>& availableLocales, const Vector<String>& requestedLocales)
{
return lookupMatcher(state, availableLocales, requestedLocales);
}
HashMap<String, String> resolveLocale(ExecState& state, const HashSet<String>& availableLocales, const Vector<String>& requestedLocales, const HashMap<String, String>& options, const char* const relevantExtensionKeys[], size_t relevantExtensionKeyCount, Vector<String> (*localeData)(const String&, size_t))
{
const String& matcher = options.get(ASCIILiteral("localeMatcher"));
MatcherResult (*matcherOperation)(ExecState&, const HashSet<String>&, const Vector<String>&);
if (matcher == "lookup") {
matcherOperation = lookupMatcher;
} else { matcherOperation = bestFitMatcher;
}
MatcherResult matcherResult = matcherOperation(state, availableLocales, requestedLocales);
String foundLocale = matcherResult.locale;
Vector<String> extensionSubtags;
if (!matcherResult.extension.isNull()) {
matcherResult.extension.split('-', extensionSubtags);
}
HashMap<String, String> result;
result.add(ASCIILiteral("dataLocale"), foundLocale);
String supportedExtension = ASCIILiteral("-u");
for (size_t keyIndex = 0; keyIndex < relevantExtensionKeyCount; ++keyIndex) {
const char* key = relevantExtensionKeys[keyIndex];
Vector<String> keyLocaleData = localeData(foundLocale, keyIndex);
ASSERT(!keyLocaleData.isEmpty());
String value = keyLocaleData[0];
String supportedExtensionAddition;
if (!extensionSubtags.isEmpty()) {
size_t keyPos = extensionSubtags.find(key);
if (keyPos != notFound) {
if (keyPos + 1 < extensionSubtags.size() && extensionSubtags[keyPos + 1].length() > 2) {
const String& requestedValue = extensionSubtags[keyPos + 1];
if (keyLocaleData.contains(requestedValue)) {
value = requestedValue;
supportedExtensionAddition = makeString('-', key, '-', value);
}
} else if (keyLocaleData.contains(static_cast<String>(ASCIILiteral("true")))) {
value = ASCIILiteral("true");
}
}
}
HashMap<String, String>::const_iterator iterator = options.find(key);
if (iterator != options.end()) {
const String& optionsValue = iterator->value;
if (!optionsValue.isNull() && keyLocaleData.contains(optionsValue)) {
if (optionsValue != value) {
value = optionsValue;
supportedExtensionAddition = String();
}
}
}
result.add(key, value);
supportedExtension.append(supportedExtensionAddition);
}
if (supportedExtension.length() > 2) {
String preExtension = foundLocale.substring(0, matcherResult.extensionIndex);
String postExtension = foundLocale.substring(matcherResult.extensionIndex);
foundLocale = preExtension + supportedExtension + postExtension;
}
result.add(ASCIILiteral("locale"), foundLocale);
return result;
}
static JSArray* lookupSupportedLocales(ExecState& state, const HashSet<String>& availableLocales, const Vector<String>& requestedLocales)
{
size_t len = requestedLocales.size();
VM& vm = state.vm();
JSGlobalObject* globalObject = state.callee()->globalObject();
JSArray* subset = JSArray::tryCreateUninitialized(vm, globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithUndecided), 0);
if (!subset) {
throwOutOfMemoryError(&state);
return nullptr;
}
for (size_t k = 0; k < len; ++k) {
const String& locale = requestedLocales[k];
String noExtensionsLocale = removeUnicodeLocaleExtension(locale);
String availableLocale = bestAvailableLocale(availableLocales, noExtensionsLocale);
if (!availableLocale.isNull())
subset->push(&state, jsString(&state, locale));
}
return subset;
}
static JSArray* bestFitSupportedLocales(ExecState& state, const HashSet<String>& availableLocales, const Vector<String>& requestedLocales)
{
return lookupSupportedLocales(state, availableLocales, requestedLocales);
}
JSValue supportedLocales(ExecState& state, const HashSet<String>& availableLocales, const Vector<String>& requestedLocales, JSValue options)
{
VM& vm = state.vm();
String matcher;
if (!options.isUndefined()) {
matcher = intlStringOption(state, options, vm.propertyNames->localeMatcher, { "lookup", "best fit" }, "localeMatcher must be either \"lookup\" or \"best fit\"", "best fit");
if (state.hadException())
return jsUndefined();
} else {
matcher = ASCIILiteral("best fit");
}
JSArray* supportedLocales;
if (matcher == "best fit") {
supportedLocales = bestFitSupportedLocales(state, availableLocales, requestedLocales);
} else {
supportedLocales = lookupSupportedLocales(state, availableLocales, requestedLocales);
}
if (state.hadException())
return jsUndefined();
PropertyNameArray keys(&state, PropertyNameMode::Strings);
supportedLocales->getOwnPropertyNames(supportedLocales, &state, keys, EnumerationMode());
if (state.hadException())
return jsUndefined();
PropertyDescriptor desc;
desc.setConfigurable(false);
desc.setWritable(false);
size_t len = keys.size();
for (size_t i = 0; i < len; ++i) {
supportedLocales->defineOwnProperty(supportedLocales, &state, keys[i], desc, true);
if (state.hadException())
return jsUndefined();
}
return supportedLocales;
}
Vector<String> numberingSystemsForLocale(const String& locale)
{
static NeverDestroyed<Vector<String>> cachedNumberingSystems;
Vector<String>& availableNumberingSystems = cachedNumberingSystems.get();
if (availableNumberingSystems.isEmpty()) {
UErrorCode status = U_ZERO_ERROR;
UEnumeration* numberingSystemNames = unumsys_openAvailableNames(&status);
ASSERT(U_SUCCESS(status));
int32_t resultLength;
while (const char* result = uenum_next(numberingSystemNames, &resultLength, &status)) {
ASSERT(U_SUCCESS(status));
availableNumberingSystems.append(String(result, resultLength));
}
uenum_close(numberingSystemNames);
}
UErrorCode status = U_ZERO_ERROR;
UNumberingSystem* defaultSystem = unumsys_open(locale.utf8().data(), &status);
ASSERT(U_SUCCESS(status));
String defaultSystemName(unumsys_getName(defaultSystem));
unumsys_close(defaultSystem);
Vector<String> numberingSystems({ defaultSystemName });
numberingSystems.appendVector(availableNumberingSystems);
return numberingSystems;
}
}
#endif // ENABLE(INTL)