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

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: Address review comments 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
Index: Source/wtf/text/StringImpl.cpp
diff --git a/Source/wtf/text/StringImpl.cpp b/Source/wtf/text/StringImpl.cpp
index 14fb36d6564cc40d8562c602b1b1fbdf9d4cea12..336ee2e653d299090f7339dc2b95eafdc2da7b3d 100644
--- a/Source/wtf/text/StringImpl.cpp
+++ b/Source/wtf/text/StringImpl.cpp
@@ -2094,4 +2094,20 @@ 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")) {
+ // FIXME: Implement
+ }
+ }
+
+ return toUpper(c);
+}
+
} // namespace WTF

Powered by Google App Engine
This is Rietveld 408576698