Fix ToUpper tests on Windows

LCMapStringEx does not unfold ligatures if there is no uppercase equivalent.
This commit is contained in:
Ted John 2018-05-15 20:34:18 +01:00 committed by Aaron van Geffen
parent bf1fd997d0
commit 71a2cb46d2
2 changed files with 3 additions and 3 deletions

View file

@ -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));

View file

@ -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)