From 7a1aa5f659110e99950b00b6b326b41436872635 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Tue, 13 Mar 2018 15:16:00 +0000 Subject: Remove usage of FXSYS_*ASCIIlower/upper methods 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 Commit-Queue: Ryan Harrison --- core/fxcrt/fx_extension.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'core/fxcrt/fx_extension.h') diff --git a/core/fxcrt/fx_extension.h b/core/fxcrt/fx_extension.h index 8e9d06694f..0f249f89c8 100644 --- a/core/fxcrt/fx_extension.h +++ b/core/fxcrt/fx_extension.h @@ -26,20 +26,20 @@ float FXSYS_wcstof(const wchar_t* pwsStr, wchar_t* FXSYS_wcsncpy(wchar_t* dstStr, const wchar_t* srcStr, size_t count); int32_t FXSYS_wcsnicmp(const wchar_t* s1, const wchar_t* s2, size_t count); -inline bool FXSYS_isASCIIlower(int32_t ch) { - return ch >= 'a' && ch <= 'z'; +inline bool FXSYS_iswlower(int32_t c) { + return u_islower(c); } -inline bool FXSYS_isASCIIupper(int32_t ch) { - return ch >= 'A' && ch <= 'Z'; +inline bool FXSYS_iswupper(int32_t c) { + return u_isupper(c); } -inline int32_t FXSYS_toASCIIlower(int32_t ch) { - return ch < 'A' || ch > 'Z' ? ch : (ch + 0x20); +inline int32_t FXSYS_towlower(wchar_t c) { + return u_tolower(c); } -inline int32_t FXSYS_toASCIIupper(int32_t ch) { - return ch < 'a' || ch > 'z' ? ch : (ch - 0x20); +inline int32_t FXSYS_towupper(wchar_t c) { + return u_toupper(c); } inline bool FXSYS_iswalpha(wchar_t c) { -- cgit v1.2.3