kernel32: Added support for C3_HIGHSURROGATE/C3_LOWSURROGATE in GetStringTypeW().

oldstable
Nikolay Sivov 2014-06-29 20:05:22 +04:00 committed by Alexandre Julliard
parent 0350b6c7fd
commit 3a2db918d9
3 changed files with 21 additions and 0 deletions

View File

@ -2504,6 +2504,9 @@ BOOL WINAPI GetStringTypeW( DWORD type, LPCWSTR src, INT count, LPWORD chartype
if ((c>=0x0600)&&(c<=0x06FF)) type3 |= C3_KASHIDA;
if ((c>=0x3000)&&(c<=0x303F)) type3 |= C3_SYMBOL;
if ((c>=0xD800)&&(c<=0xDBFF)) type3 |= C3_HIGHSURROGATE;
if ((c>=0xDC00)&&(c<=0xDFFF)) type3 |= C3_LOWSURROGATE;
if ((c>=0xFF00)&&(c<=0xFF60)) type3 |= C3_FULLWIDTH;
if ((c>=0xFF00)&&(c<=0xFF20)) type3 |= C3_SYMBOL;
if ((c>=0xFF3B)&&(c<=0xFF40)) type3 |= C3_SYMBOL;

View File

@ -3271,6 +3271,7 @@ static void test_GetStringTypeW(void)
static const WCHAR space_special[] = {0x09, 0x0d, 0x85};
WORD types[20];
WCHAR ch;
int i;
memset(types,0,sizeof(types));
@ -3327,6 +3328,21 @@ static void test_GetStringTypeW(void)
GetStringTypeW(CT_CTYPE1, space_special, 3, types);
for (i = 0; i < 3; i++)
ok(types[i] & C1_SPACE || broken(types[i] == C1_CNTRL) || broken(types[i] == 0), "incorrect types returned for %x -> (%x does not have %x)\n",space_special[i], types[i], C1_SPACE );
/* surrogate pairs */
ch = 0xd800;
memset(types, 0, sizeof(types));
GetStringTypeW(CT_CTYPE3, &ch, 1, types);
if (types[0] == C3_NOTAPPLICABLE)
win_skip("C3_HIGHSURROGATE/C3_LOWSURROGATE are not supported.\n");
else {
ok(types[0] == C3_HIGHSURROGATE, "got %x\n", types[0]);
ch = 0xdc00;
memset(types, 0, sizeof(types));
GetStringTypeW(CT_CTYPE3, &ch, 1, types);
ok(types[0] == C3_LOWSURROGATE, "got %x\n", types[0]);
}
}
static void test_IdnToNameprepUnicode(void)

View File

@ -460,6 +460,8 @@ static const WCHAR LOCALE_NAME_SYSTEM_DEFAULT[] = {'!','s','y','s','-','d','e','
#define C3_IDEOGRAPH 0x0100
#define C3_KASHIDA 0x0200
#define C3_LEXICAL 0x0400
#define C3_HIGHSURROGATE 0x0800
#define C3_LOWSURROGATE 0x1000
#define C3_ALPHA 0x8000
#define C3_NOTAPPLICABLE 0x0000