MCPcopy Create free account
hub / github.com/buke/quickjs-go / compose_pair

Function compose_pair

deps/quickjs/libunicode.c:936–949  ·  view source on GitHub ↗

return 0 if not found */

Source from the content-addressed store, hash-verified

934
935/* return 0 if not found */
936static 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
951int unicode_normalize(uint32_t **pdst, const uint32_t *src, int src_len,
952 UnicodeNormalizationEnum n_type,

Callers 1

unicode_normalizeFunction · 0.85

Calls 1

unicode_compose_pairFunction · 0.85

Tested by

no test coverage detected