Commit db3ae2ca authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

libport: Add support for singleton decomposition.

parent eceb69e1
......@@ -5685,6 +5685,11 @@ static void test_NormalizeString(void)
static const WCHAR part1_str10[] = {0x309B,0};
static const WCHAR part1_nfkc10[] = {0x20,0x3099,0};
/* ANGSTROM SIGN */
static const WCHAR part1_str11[] = {0x212B,0};
static const WCHAR part1_nfc11[] = {0xC5,0};
static const WCHAR part1_nfd11[] = {'A',0x030A,0};
struct test_data_normal {
const WCHAR *str;
const WCHAR *expected[4];
......@@ -5713,6 +5718,7 @@ static void test_NormalizeString(void)
{ part1_str8, { part1_str8, part1_nfd8, part1_str8, part1_nfd8 }, { 1, 0, 1, 0 } },
{ part1_str9, { part1_str9, part1_str9, part1_nfkc9, part1_nfkc9 }, { 1, 0, 1, 0 } },
{ part1_str10, { part1_str10, part1_str10, part1_nfkc10, part1_nfkc10 }, { 1, 0, 1, 0 } },
{ part1_str11, { part1_nfc11, part1_nfd11, part1_nfc11, part1_nfd11 }, { 1, 0, 1, 0 } },
{ 0 }
};
const struct test_data_normal *ptest = test_arr;
......
......@@ -528,11 +528,19 @@ sub READ_DEFAULTS($)
$decomp_table[$src] = [ hex $1, hex $2 ];
push @compose_table, [ hex $1, hex $2, $src ];
}
elsif ($decomp =~ /^(<[a-z]+>\s)*([0-9a-fA-F]+)$/ &&
(($src >= 0xf900 && $src < 0xfb00) || ($src >= 0xfe30 && $src < 0xfffd)))
elsif ($decomp =~ /^([0-9a-fA-F]+)$/)
{
# Single char decomposition
if (hex $1 < 65536)
{
$decomp_table[$src] = [ hex $1, 0 ];
}
if (($src >= 0xf900 && $src < 0xfb00) || ($src >= 0xfe30 && $src < 0xfffd))
{
# Single char decomposition in the compatibility range
$compatmap_table[$src] = hex $2;
$compatmap_table[$src] = hex $1;
}
}
}
else
......@@ -2494,7 +2502,7 @@ unsigned int DECLSPEC_HIDDEN wine_decompose( int flags, WCHAR ch, WCHAR *dst, un
if (!ptr)
{
ptr = table + table[table[ch >> 8] + ((ch >> 4) & 0x0f)] + 2 * (ch & 0xf);
len = 2;
len = ptr[1] ? 2 : 1;
}
if (!*ptr) return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment