Piotr Caban (@piotr) commented about dlls/msvcrt/locale.c:
#endif
MultiByteToWideChar(CP_ACP, 0, search_language_buf, -1, search.search_language, MAX_ELEM_LEN);
if (!remapped)
MultiByteToWideChar(CP_ACP, 0, search_country_buf, -1, search.search_country, MAX_ELEM_LEN);
EnumSystemLocalesEx( find_best_locale_proc, 0, (LPARAM)&search, NULL);
if (search.allow_sname && IsValidLocaleName(search.search_language))
You should probably check that country and code page were not specified (I didn't test that).