https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5d1ae45b83642312c4624…
commit 5d1ae45b83642312c4624198d1baeaac914eb848
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Tue Mar 28 08:37:17 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Mar 28 08:37:17 2023 +0900
[KERNEL32] LCMapString: Hiragana/Katakana conversion (#5200)
Implement LCMAP_KATAKANA and LCMAP_HIRAGANA flags. CORE-11700
---
dll/win32/kernel32/winnls/string/lang.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/dll/win32/kernel32/winnls/string/lang.c
b/dll/win32/kernel32/winnls/string/lang.c
index 4841e7a9d57..c976310596a 100644
--- a/dll/win32/kernel32/winnls/string/lang.c
+++ b/dll/win32/kernel32/winnls/string/lang.c
@@ -2008,6 +2008,39 @@ INT WINAPI LCMapStringEx(LPCWSTR name, DWORD flags, LPCWSTR src,
INT srclen, LPW
}
}
+#ifdef __REACTOS__
+ if (flags & LCMAP_KATAKANA)
+ {
+ INT convlen = dst_ptr - dst;
+ for (dst_ptr = dst; convlen; --convlen, ++dst_ptr)
+ {
+ /*
+ * U+3041 ... U+3093: Hiragana
+ * U+3095: Hiragana Letter Small KA
+ * U+309D: Hiragana Iteration Mark
+ */
+ WCHAR wch = *dst_ptr;
+ if ((0x3041 <= wch && wch <= 0x3093) || wch == 0x3095 || wch ==
0x309D)
+ *dst_ptr = wch + 0x60; /* Hiragana to Katanaka */
+ }
+ }
+ else if (flags & LCMAP_HIRAGANA)
+ {
+ INT convlen = dst_ptr - dst;
+ for (dst_ptr = dst; convlen; --convlen, ++dst_ptr)
+ {
+ /*
+ * U+30A1 ... U+30F3: Katakana
+ * U+30F5: Katakana Letter Small KA
+ * U+30FD: Katakana Iteration Mark
+ */
+ WCHAR wch = *dst_ptr;
+ if ((0x30A1 <= wch && wch <= 0x30F3) || wch == 0x30F5 || wch ==
0x30FD)
+ *dst_ptr = wch - 0x60; /* Katanaka to Hiragana */
+ }
+ }
+#endif
+
if (srclen)
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);