From 71a2cb46d24fda5953825aa18b9dd3a367e12d1b Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 15 May 2018 20:34:18 +0100 Subject: [PATCH] Fix ToUpper tests on Windows LCMapStringEx does not unfold ligatures if there is no uppercase equivalent. --- src/openrct2/core/String.cpp | 4 ++-- test/tests/StringTest.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/core/String.cpp b/src/openrct2/core/String.cpp index b3e25dcf3d..45070d58a0 100644 --- a/src/openrct2/core/String.cpp +++ b/src/openrct2/core/String.cpp @@ -90,9 +90,9 @@ namespace String { #ifdef _WIN32 int srcLen = (int)src.size(); - int sizeReq = MultiByteToWideChar(CP_ACP, 0, src.data(), srcLen, nullptr, 0); + int sizeReq = MultiByteToWideChar(CODE_PAGE::CP_UTF8, 0, src.data(), srcLen, nullptr, 0); auto result = std::wstring(sizeReq, 0); - MultiByteToWideChar(CP_ACP, 0, src.data(), srcLen, result.data(), sizeReq); + MultiByteToWideChar(CODE_PAGE::CP_UTF8, 0, src.data(), srcLen, result.data(), sizeReq); return result; #else icu::UnicodeString str = icu::UnicodeString::fromUTF8(std::string(src)); diff --git a/test/tests/StringTest.cpp b/test/tests/StringTest.cpp index 968398694f..794327d3ea 100644 --- a/test/tests/StringTest.cpp +++ b/test/tests/StringTest.cpp @@ -126,7 +126,7 @@ TEST_F(StringTest, ToUpper_Basic) } TEST_F(StringTest, ToUpper_Dutch) { - auto actual = String::ToUpper(u8"fijntjes puffend fietsen"); + auto actual = String::ToUpper(u8"fijntjes puffend fietsen"); ASSERT_STREQ(actual.c_str(), u8"FIJNTJES PUFFEND FIETSEN"); } TEST_F(StringTest, ToUpper_French)