summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_extension.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-03-13 15:16:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-13 15:16:00 +0000
commit7a1aa5f659110e99950b00b6b326b41436872635 (patch)
tree16d89f9e2fc865b1a7a7727190938ad8499551e5 /core/fxcrt/fx_extension.cpp
parent0c6b98182403868334b4dfe4852caa4d0e2ba272 (diff)
downloadpdfium-7a1aa5f659110e99950b00b6b326b41436872635.tar.xz
Remove usage of FXSYS_*ASCIIlower/upper methodschromium/3370
This replaces them with equivalent FXSYS_*wlower/upper methods, which uses ICU to perform the correct Unicode operations. BUG=pdfium:1035 Change-Id: I432db5bef9eda71762016b619d93155949d054db Reviewed-on: https://pdfium-review.googlesource.com/28530 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_extension.cpp')
-rw-r--r--core/fxcrt/fx_extension.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/fxcrt/fx_extension.cpp b/core/fxcrt/fx_extension.cpp
index 7bfcec6d42..4448a71a9b 100644
--- a/core/fxcrt/fx_extension.cpp
+++ b/core/fxcrt/fx_extension.cpp
@@ -68,8 +68,8 @@ int32_t FXSYS_wcsnicmp(const wchar_t* s1, const wchar_t* s2, size_t count) {
ASSERT(s1 && s2 && count > 0);
wchar_t wch1 = 0, wch2 = 0;
while (count-- > 0) {
- wch1 = static_cast<wchar_t>(FXSYS_toASCIIlower(*s1++));
- wch2 = static_cast<wchar_t>(FXSYS_toASCIIlower(*s2++));
+ wch1 = static_cast<wchar_t>(FXSYS_towlower(*s1++));
+ wch2 = static_cast<wchar_t>(FXSYS_towlower(*s2++));
if (wch1 != wch2)
break;
}
@@ -80,7 +80,7 @@ uint32_t FX_HashCode_GetA(const ByteStringView& str, bool bIgnoreCase) {
uint32_t dwHashCode = 0;
if (bIgnoreCase) {
for (const auto& c : str)
- dwHashCode = 31 * dwHashCode + FXSYS_toASCIIlower(c);
+ dwHashCode = 31 * dwHashCode + tolower(c);
} else {
for (const auto& c : str)
dwHashCode = 31 * dwHashCode + c;
@@ -92,7 +92,7 @@ uint32_t FX_HashCode_GetW(const WideStringView& str, bool bIgnoreCase) {
uint32_t dwHashCode = 0;
if (bIgnoreCase) {
for (const auto& c : str)
- dwHashCode = 1313 * dwHashCode + FXSYS_toASCIIlower(c);
+ dwHashCode = 1313 * dwHashCode + FXSYS_towlower(c);
} else {
for (const auto& c : str)
dwHashCode = 1313 * dwHashCode + c;