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

Unified Diff: Source/wtf/text/StringImpl.cpp

Issue 1135003004: Make small-caps work correctly with tr locale (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add back TestExpectations change Created 5 years, 7 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 | « Source/wtf/text/StringImpl.h ('k') | Source/wtf/unicode/CharacterNames.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/StringImpl.cpp
diff --git a/Source/wtf/text/StringImpl.cpp b/Source/wtf/text/StringImpl.cpp
index 14fb36d6564cc40d8562c602b1b1fbdf9d4cea12..7f674c7a05c573e6cdcf8510ebd55ebb6587d745 100644
--- a/Source/wtf/text/StringImpl.cpp
+++ b/Source/wtf/text/StringImpl.cpp
@@ -2094,4 +2094,21 @@ size_t StringImpl::sizeInBytes() const
return size + sizeof(*this);
}
+UChar32 toUpper(UChar32 c, const AtomicString& localeIdentifier)
+{
+ if (!localeIdentifier.isNull()) {
+ if (localeIdMatchesLang(localeIdentifier, "tr") || localeIdMatchesLang(localeIdentifier, "az")) {
+ if (c == 'i')
+ return latinCapitalLetterIWithDotAbove;
+ if (c == latinSmallLetterDotlessI)
+ return 'I';
+ } else if (localeIdMatchesLang(localeIdentifier, "lt")) {
+ // TODO(rob.buis) implement upper-casing rules for lt
+ // like in StringImpl::upper(locale).
+ }
+ }
+
+ return toUpper(c);
+}
+
} // namespace WTF
« no previous file with comments | « Source/wtf/text/StringImpl.h ('k') | Source/wtf/unicode/CharacterNames.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698