mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[KERNEL32] LCMapString: Hiragana/Katakana conversion (#5200)
Implement LCMAP_KATAKANA and LCMAP_HIRAGANA flags. CORE-11700
This commit is contained in:
parent
3526ffc094
commit
5d1ae45b83
1 changed files with 33 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue