Commit b35faeb5 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Reject UTF-8 locales in setlocale function.

parent fac521ee
......@@ -134,7 +134,7 @@ static void test_setlocale(void)
ok(ret != NULL, "expected success, but got NULL\n");
if(!strcmp(names[i], "syr-SY") && GetACP() == CP_UTF8)
{
todo_wine ok(!strcmp(ret, "LC_COLLATE=syr-SY;LC_CTYPE=EN-US;LC_MONETARY=syr-SY;"
ok(!strcmp(ret, "LC_COLLATE=syr-SY;LC_CTYPE=EN-US;LC_MONETARY=syr-SY;"
"LC_NUMERIC=syr-SY;LC_TIME=syr-SY"), "got %s\n", ret);
}
else
......
......@@ -1334,6 +1334,14 @@ static pthreadlocinfo create_locinfo(int category,
}
for(i=1; i<6; i++) {
#if _MSVCR_VER < 140
if(i==LC_CTYPE && cp[i]==CP_UTF8) {
locale_name[i] = NULL;
locale_len[i] = 0;
lcid[i] = old_locinfo ? old_locinfo->lc_handle[i] : 0;
cp[i] = old_locinfo ? old_locinfo->lc_id[i].wCodePage : 0;
}
#endif
if(category!=LC_ALL && category!=i) {
if(old_locinfo) {
lcid[i] = old_locinfo->lc_handle[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment