diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 0f370273a98..4d1eac6ebee 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -3557,8 +3557,16 @@ INT WINAPI LCMapStringEx(LPCWSTR name, DWORD flags, LPCWSTR src, INT srclen, LPW else if (flags & LCMAP_HALFWIDTH) { for (len = 0; srclen; src++, srclen--, len++) - if (decompose_katakana(*src, NULL, 0) == 2) + { + WCHAR wch = *src; + /* map Hiragana to Katakana before decomposition if needed */ + if ((flags & LCMAP_KATAKANA) && + ((wch >= 0x3041 && wch <= 0x3096) || wch == 0x309D || wch == 0x309E)) + wch += 0x60; + + if (decompose_katakana(wch, NULL, 0) == 2) len++; + } } else len = srclen; diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index b8ced500f6d..d3eb2ecf15e 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -2537,7 +2537,6 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f ok(!lstrcmpW(buf, halfwidth_text2), "%s string compare mismatch\n", func_name); ret2 = func_ptr(LCMAP_HALFWIDTH | LCMAP_KATAKANA, japanese_text, -1, NULL, 0); - todo_wine ok(ret == ret2, "%s ret %d, expected value %d\n", func_name, ret, ret2); /* test buffer overflow */