Nikolay Sivov : kernel32: Set C3_KASHIDA only for kashida character.

Alexandre Julliard julliard at wine.codeweavers.com
Mon May 16 10:36:44 CDT 2016


Module: wine
Branch: master
Commit: 632266e5b589232fbb2866fdf810087d9e8d1e78
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=632266e5b589232fbb2866fdf810087d9e8d1e78

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sun May 15 10:30:33 2016 +0300

kernel32: Set C3_KASHIDA only for kashida character.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/locale.c       |  2 +-
 dlls/kernel32/tests/locale.c | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index 14b2ba7..b5a8680 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -2864,7 +2864,7 @@ BOOL WINAPI GetStringTypeW( DWORD type, LPCWSTR src, INT count, LPWORD chartype
             if ((c>=0x30A0)&&(c<=0x30FF)) type3 |= C3_KATAKANA;
             if ((c>=0x3040)&&(c<=0x309F)) type3 |= C3_HIRAGANA;
             if ((c>=0x4E00)&&(c<=0x9FAF)) type3 |= C3_IDEOGRAPH;
-            if ((c>=0x0600)&&(c<=0x06FF)) type3 |= C3_KASHIDA;
+            if (c == 0x0640) type3 |= C3_KASHIDA;
             if ((c>=0x3000)&&(c<=0x303F)) type3 |= C3_SYMBOL;
 
             if ((c>=0xD800)&&(c<=0xDBFF)) type3 |= C3_HIGHSURROGATE;
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index 70944a2..d677836 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -3766,6 +3766,18 @@ static void test_GetStringTypeW(void)
     GetStringTypeW(CT_CTYPE1, ch, 2, types);
     ok(types[0] == (C1_DEFINED|C1_SPACE), "got %x\n", types[0]);
     ok(types[1] == (C1_DEFINED|C1_SPACE), "got %x\n", types[1]);
+
+    /* check Arabic range for kashida flag */
+    for (ch[0] = 0x600; ch[0] <= 0x6ff; ch[0] += 1)
+    {
+        types[0] = 0;
+        ret = GetStringTypeW(CT_CTYPE3, ch, 1, types);
+        ok(ret, "%#x: failed %d\n", ch[0], ret);
+        if (ch[0] == 0x640) /* ARABIC TATWEEL (Kashida) */
+            ok(types[0] & C3_KASHIDA, "%#x: type %#x\n", ch[0], types[0]);
+        else
+            ok(!(types[0] & C3_KASHIDA), "%#x: type %#x\n", ch[0], types[0]);
+    }
 }
 
 static void test_IdnToNameprepUnicode(void)




More information about the wine-cvs mailing list