| Index: Source/platform/text/PlatformLocale.cpp
|
| diff --git a/Source/platform/text/PlatformLocale.cpp b/Source/platform/text/PlatformLocale.cpp
|
| index 8a1801d9c8bb5c738c76a2b421ddc66889262ec8..28e6aec9b56983b81e63d585b559ae7733869cbf 100644
|
| --- a/Source/platform/text/PlatformLocale.cpp
|
| +++ b/Source/platform/text/PlatformLocale.cpp
|
| @@ -248,6 +248,18 @@ void Locale::setLocaleData(const Vector<String, DecimalSymbolsSize>& symbols, co
|
| m_negativeSuffix = negativeSuffix;
|
| ASSERT(!m_positivePrefix.isEmpty() || !m_positiveSuffix.isEmpty() || !m_negativePrefix.isEmpty() || !m_negativeSuffix.isEmpty());
|
| m_hasLocaleData = true;
|
| +
|
| + StringBuilder builder;
|
| + for (size_t i = 0; i < DecimalSymbolsSize; ++i) {
|
| + // We don't accept group separatros.
|
| + if (i != GroupSeparatorIndex)
|
| + builder.append(m_decimalSymbols[i]);
|
| + }
|
| + builder.append(m_positivePrefix);
|
| + builder.append(m_positiveSuffix);
|
| + builder.append(m_negativePrefix);
|
| + builder.append(m_negativeSuffix);
|
| + m_acceptableNumberCharacters = builder.toString();
|
| }
|
|
|
| String Locale::convertToLocalizedNumber(const String& input)
|
| @@ -381,6 +393,20 @@ String Locale::convertFromLocalizedNumber(const String& localized)
|
| return builder.toString();
|
| }
|
|
|
| +String Locale::stripInvalidNumberCharacters(const String& input, const String& standardChars) const
|
| +{
|
| + StringBuilder builder;
|
| + builder.reserveCapacity(input.length());
|
| + for (unsigned i = 0; i < input.length(); ++i) {
|
| + UChar ch = input[i];
|
| + if (standardChars.find(ch) != kNotFound)
|
| + builder.append(ch);
|
| + else if (m_acceptableNumberCharacters.find(ch) != kNotFound)
|
| + builder.append(ch);
|
| + }
|
| + return builder.toString();
|
| +}
|
| +
|
| #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
|
| String Locale::localizedDecimalSeparator()
|
| {
|
|
|