Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(628)

Unified Diff: content/browser/hyphenation/hyphenation_impl.cc

Issue 2163603002: Fix hyphenation for lang="de" and other fallback on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change test to pass on M Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/hyphenation/hyphenation_impl.cc
diff --git a/content/browser/hyphenation/hyphenation_impl.cc b/content/browser/hyphenation/hyphenation_impl.cc
index 5049836632e5243463a1580cdcd7d950b296f6d4..daac2f1017041b1ae4913254e744c1bd08bb63e0 100644
--- a/content/browser/hyphenation/hyphenation_impl.cc
+++ b/content/browser/hyphenation/hyphenation_impl.cc
@@ -10,6 +10,7 @@
#include "base/files/file.h"
#include "base/files/file_path.h"
+#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "mojo/public/cpp/system/platform_handle.h"
@@ -18,8 +19,9 @@ namespace {
using DictionaryFileMap = std::unordered_map<std::string, base::File>;
static bool IsValidLocale(const std::string& locale) {
- return std::all_of(locale.cbegin(), locale.cend(),
- [](const char ch) { return isalpha(ch) || ch == '-'; });
+ return std::all_of(locale.cbegin(), locale.cend(), [](const char ch) {
+ return base::IsAsciiAlpha(ch) || base::IsAsciiDigit(ch) || ch == '-';
+ });
}
static base::File& GetDictionaryFile(const std::string& locale) {

Powered by Google App Engine
This is Rietveld 408576698