From: Piotr Caban Subject: [PATCH] ucrtbase: Add support for utf8 codepage in setlocale. Message-Id: <0234d61c-aaa8-a280-a8b6-16a5b36e00e7@codeweavers.com> Date: Wed, 11 Nov 2020 18:49:08 +0100 Signed-off-by: Piotr Caban --- Fixes ucrtbase part of bug 50019. dlls/msvcrt/locale.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index c49439951a9..fda3d11b86d 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -351,6 +351,11 @@ LCID MSVCRT_locale_to_LCID(const char *locale, unsigned short *codepage, BOOL *s } else if (!MSVCRT__strnicmp(cp, ".OCP", 4)) { GetLocaleInfoW(lcid, LOCALE_IDEFAULTCODEPAGE | LOCALE_RETURN_NUMBER, (WCHAR *)&locale_cp, sizeof(DWORD)/sizeof(WCHAR)); +#if _MSVCR_VER >= 140 + } else if (!MSVCRT__strnicmp(cp, ".UTF-8", 6) + || !MSVCRT__strnicmp(cp, ".UTF8", 5)) { + locale_cp = CP_UTF8; +#endif } else { locale_cp = atoi(cp + 1); }