return 0 if not found */
| 934 | |
| 935 | /* return 0 if not found */ |
| 936 | static int compose_pair(uint32_t c0, uint32_t c1) |
| 937 | { |
| 938 | /* Hangul composition */ |
| 939 | if (c0 >= 0x1100 && c0 < 0x1100 + 19 && |
| 940 | c1 >= 0x1161 && c1 < 0x1161 + 21) { |
| 941 | return 0xac00 + (c0 - 0x1100) * 588 + (c1 - 0x1161) * 28; |
| 942 | } else if (c0 >= 0xac00 && c0 < 0xac00 + 11172 && |
| 943 | (c0 - 0xac00) % 28 == 0 && |
| 944 | c1 >= 0x11a7 && c1 < 0x11a7 + 28) { |
| 945 | return c0 + c1 - 0x11a7; |
| 946 | } else { |
| 947 | return unicode_compose_pair(c0, c1); |
| 948 | } |
| 949 | } |
| 950 | |
| 951 | int unicode_normalize(uint32_t **pdst, const uint32_t *src, int src_len, |
| 952 | UnicodeNormalizationEnum n_type, |
no test coverage detected