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

Unified Diff: base/strings/string_util.cc

Issue 1399253004: Make base::IsUnicodeWhitespace('\0') return false. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add non-ASCII codepoint tests Created 5 years, 2 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
« no previous file with comments | « base/strings/string_util.h ('k') | base/strings/string_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/strings/string_util.cc
diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc
index d7a1d54c72210afe3f7777a43ec4d2e5e374fd47..a978891d57e291e5f0bec9586bbe20b04d4bcf43 100644
--- a/base/strings/string_util.cc
+++ b/base/strings/string_util.cc
@@ -674,6 +674,15 @@ char HexDigitToInt(wchar_t c) {
return 0;
}
+bool IsUnicodeWhitespace(wchar_t c) {
+ // kWhitespaceWide is a NULL-terminated string
+ for (const wchar_t* cur = kWhitespaceWide; *cur; ++cur) {
+ if (*cur == c)
+ return true;
+ }
+ return false;
+}
+
static const char* const kByteStringsUnlocalized[] = {
" B",
" kB",
« no previous file with comments | « base/strings/string_util.h ('k') | base/strings/string_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698