Signed-off-by: Bernhard Kölbl bkoelbl@codeweavers.com
-- v2: make_unicode: Add some halfwidth mapping exceptions.
From: Bernhard Kölbl bkoelbl@codeweavers.com
Signed-off-by: Bernhard Kölbl bkoelbl@codeweavers.com --- dlls/kernel32/tests/locale.c | 8 ++++++++ tools/make_unicode | 2 ++ 2 files changed, 10 insertions(+)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 825d6f95f62..ebe9c129c9d 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -2841,6 +2841,14 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f ok(!ret, "%s func_ptr should fail with srclen = 0\n", func_name); ok(GetLastError() == ERROR_INVALID_PARAMETER, "%s unexpected error code %ld\n", func_name, GetLastError()); + + /* test for characters which don't get mapped to their + halfwidth counterparts on LCMAP_HALFWIDTH */ + buf[0] = buf2[0] = L'→'; + buf[1] = buf2[1] = L'○'; + ret = func_ptr(LCMAP_HALFWIDTH, buf, 2, buf2, 2); + ok(ret == 2, "%s ret %d, expected value 2\n", func_name, ret); + ok(!memcmp(buf, buf2, sizeof(WCHAR) * 2), "in- and output must be equal\n"); }
static INT LCMapStringW_wrapper(DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen) diff --git a/tools/make_unicode b/tools/make_unicode index cacc062b230..db36b2043d0 100755 --- a/tools/make_unicode +++ b/tools/make_unicode @@ -5318,6 +5318,8 @@ sub build_charmaps_data() $halfwidth_table[0x2019] = 0x0027; $halfwidth_table[0x201c] = 0x0022; $halfwidth_table[0x201d] = 0x0022; + $halfwidth_table[0x2192] = 0x2192; + $halfwidth_table[0x25cb] = 0x25cb; $halfwidth_table[0x309b] = 0xff9e; $halfwidth_table[0x309c] = 0xff9f; $fullwidth_table[0x309b] = 0x3099;
Alexandre Julliard (@julliard) commented about dlls/kernel32/tests/locale.c:
ok(!ret, "%s func_ptr should fail with srclen = 0\n", func_name); ok(GetLastError() == ERROR_INVALID_PARAMETER, "%s unexpected error code %ld\n", func_name, GetLastError());
- /* test for characters which don't get mapped to their
halfwidth counterparts on LCMAP_HALFWIDTH */
- buf[0] = buf2[0] = L'→';
- buf[1] = buf2[1] = L'○';
Please use hex sequences instead of Unicode chars.
I don't think it makes much sense to change just one of the arrows, you should at least test them all.
What app depends on this?
On Mon Sep 15 10:22:29 2025 +0000, Alexandre Julliard wrote:
Please use hex sequences instead of Unicode chars. I don't think it makes much sense to change just one of the arrows, you should at least test them all. What app depends on this?
Sure, will do.
The game ディスガイア PC depends on this. It apparently has all its text stored in full width and then converts it to half width, when playing on English. Without this change, some characters will show up incorrectly.