1 /* Test of canonical decomposition of Unicode characters.
2 Copyright (C) 2009-2020 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
17 /* Written by Bruno Haible <bruno@clisp.org>, 2009. */
28 ucs4_t decomposed
[UC_DECOMPOSITION_MAX_LENGTH
];
32 ret
= uc_canonical_decomposition (0x0020, decomposed
);
35 /* LATIN CAPITAL LETTER A WITH DIAERESIS */
36 ret
= uc_canonical_decomposition (0x00C4, decomposed
);
38 ASSERT (decomposed
[0] == 0x0041);
39 ASSERT (decomposed
[1] == 0x0308);
41 /* LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON */
42 ret
= uc_canonical_decomposition (0x01DE, decomposed
);
44 ASSERT (decomposed
[0] == 0x00C4);
45 ASSERT (decomposed
[1] == 0x0304);
47 /* GREEK DIALYTIKA AND PERISPOMENI */
48 ret
= uc_canonical_decomposition (0x1FC1, decomposed
);
50 ASSERT (decomposed
[0] == 0x00A8);
51 ASSERT (decomposed
[1] == 0x0342);
54 ret
= uc_canonical_decomposition (0x2113, decomposed
);
58 ret
= uc_canonical_decomposition (0x00A0, decomposed
);
61 /* ARABIC LETTER VEH INITIAL FORM */
62 ret
= uc_canonical_decomposition (0xFB6C, decomposed
);
65 /* ARABIC LETTER VEH MEDIAL FORM */
66 ret
= uc_canonical_decomposition (0xFB6D, decomposed
);
69 /* ARABIC LETTER VEH FINAL FORM */
70 ret
= uc_canonical_decomposition (0xFB6B, decomposed
);
73 /* ARABIC LETTER VEH ISOLATED FORM */
74 ret
= uc_canonical_decomposition (0xFB6A, decomposed
);
77 /* CIRCLED NUMBER FIFTEEN */
78 ret
= uc_canonical_decomposition (0x246E, decomposed
);
82 ret
= uc_canonical_decomposition (0x2122, decomposed
);
85 /* LATIN SUBSCRIPT SMALL LETTER I */
86 ret
= uc_canonical_decomposition (0x1D62, decomposed
);
89 /* PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS */
90 ret
= uc_canonical_decomposition (0xFE35, decomposed
);
93 /* FULLWIDTH LATIN CAPITAL LETTER A */
94 ret
= uc_canonical_decomposition (0xFF21, decomposed
);
97 /* HALFWIDTH IDEOGRAPHIC COMMA */
98 ret
= uc_canonical_decomposition (0xFF64, decomposed
);
101 /* SMALL IDEOGRAPHIC COMMA */
102 ret
= uc_canonical_decomposition (0xFE51, decomposed
);
106 ret
= uc_canonical_decomposition (0x3392, decomposed
);
109 /* VULGAR FRACTION THREE EIGHTHS */
110 ret
= uc_canonical_decomposition (0x215C, decomposed
);
114 ret
= uc_canonical_decomposition (0x00B5, decomposed
);
117 /* ARABIC LIGATURE SALLALLAHOU ALAYHE WASALLAM */
118 ret
= uc_canonical_decomposition (0xFDFA, decomposed
);
121 /* HANGUL SYLLABLE GEUL */
122 ret
= uc_canonical_decomposition (0xAE00, decomposed
);
123 /* See the clarification at <https://www.unicode.org/versions/Unicode5.1.0/>,
124 section "Clarification of Hangul Jamo Handling". */
127 ASSERT (decomposed
[0] == 0xADF8);
128 ASSERT (decomposed
[1] == 0x11AF);
131 ASSERT (decomposed
[0] == 0x1100);
132 ASSERT (decomposed
[1] == 0x1173);
133 ASSERT (decomposed
[2] == 0x11AF);
136 /* HANGUL SYLLABLE GEU */
137 ret
= uc_canonical_decomposition (0xADF8, decomposed
);
139 ASSERT (decomposed
[0] == 0x1100);
140 ASSERT (decomposed
[1] == 0x1173);