Mercurial > irccd
changeset 983:d5aa6aba8959
irccd: upgrade unicode
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 09 Feb 2021 22:31:53 +0100 |
parents | 0e9e09941f5a |
children | 2e4b29ab8e9c |
files | irccd/unicode.c irccd/unicode.h |
diffstat | 2 files changed, 316 insertions(+), 85 deletions(-) [+] |
line wrap: on
line diff
--- a/irccd/unicode.c Tue Feb 09 22:03:07 2021 +0100 +++ b/irccd/unicode.c Tue Feb 09 22:31:53 2021 +0100 @@ -1,7 +1,7 @@ /* * unicode.c -- UTF-8 to UTF-32 conversions and various operations * - * Copyright (c) 2013-2020 David Demelier <markand@malikania.fr> + * Copyright (c) 2013-2021 David Demelier <markand@malikania.fr> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -66,7 +66,7 @@ 0xfeff, 0xfeff, }; -bool +int uni_isspace(uint32_t c) { const uint32_t *p; @@ -74,9 +74,9 @@ p = search(c, isspacer, nelem (isspacer) / 2, 2); if (p && c >= p[0] && c <= p[1]) - return true; + return 1; - return false; + return 0; } static const uint32_t isdigitr[] = { @@ -118,21 +118,32 @@ 0xabf0, 0xabf9, 0xff10, 0xff19, 0x104a0, 0x104a9, + 0x10d30, 0x10d39, 0x11066, 0x1106f, 0x110f0, 0x110f9, 0x11136, 0x1113f, 0x111d0, 0x111d9, 0x112f0, 0x112f9, + 0x11450, 0x11459, 0x114d0, 0x114d9, 0x11650, 0x11659, 0x116c0, 0x116c9, + 0x11730, 0x11739, 0x118e0, 0x118e9, + 0x11950, 0x11959, + 0x11c50, 0x11c59, + 0x11d50, 0x11d59, + 0x11da0, 0x11da9, 0x16a60, 0x16a69, 0x16b50, 0x16b59, 0x1d7ce, 0x1d7ff, + 0x1e140, 0x1e149, + 0x1e2f0, 0x1e2f9, + 0x1e950, 0x1e959, + 0x1fbf0, 0x1fbf9, }; -bool +int uni_isdigit(uint32_t c) { const uint32_t *p; @@ -140,9 +151,9 @@ p = search(c, isdigitr, nelem (isdigitr) / 2, 2); if (p && c >= p[0] && c <= p[1]) - return true; + return 1; - return false; + return 0; } static const uint32_t isalphar[] = { @@ -162,9 +173,9 @@ 0x03f7, 0x0481, 0x048a, 0x052f, 0x0531, 0x0556, - 0x0561, 0x0587, + 0x0560, 0x0588, 0x05d0, 0x05ea, - 0x05f0, 0x05f2, + 0x05ef, 0x05f2, 0x0620, 0x064a, 0x066e, 0x066f, 0x0671, 0x06d3, @@ -177,7 +188,9 @@ 0x07f4, 0x07f5, 0x0800, 0x0815, 0x0840, 0x0858, - 0x08a0, 0x08b2, + 0x0860, 0x086a, + 0x08a0, 0x08b4, + 0x08b6, 0x08c7, 0x0904, 0x0939, 0x0958, 0x0961, 0x0971, 0x0980, @@ -225,7 +238,7 @@ 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c39, - 0x0c58, 0x0c59, + 0x0c58, 0x0c5a, 0x0c60, 0x0c61, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, @@ -234,10 +247,11 @@ 0x0cb5, 0x0cb9, 0x0ce0, 0x0ce1, 0x0cf1, 0x0cf2, - 0x0d05, 0x0d0c, + 0x0d04, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, - 0x0d60, 0x0d61, + 0x0d54, 0x0d56, + 0x0d5f, 0x0d61, 0x0d7a, 0x0d7f, 0x0d85, 0x0d96, 0x0d9a, 0x0db1, @@ -247,12 +261,9 @@ 0x0e32, 0x0e33, 0x0e40, 0x0e46, 0x0e81, 0x0e82, - 0x0e87, 0x0e88, - 0x0e94, 0x0e97, - 0x0e99, 0x0e9f, - 0x0ea1, 0x0ea3, - 0x0eaa, 0x0eab, - 0x0ead, 0x0eb0, + 0x0e86, 0x0e8a, + 0x0e8c, 0x0ea3, + 0x0ea7, 0x0eb0, 0x0eb2, 0x0eb3, 0x0ec0, 0x0ec4, 0x0edc, 0x0edf, @@ -282,7 +293,8 @@ 0x1312, 0x1315, 0x1318, 0x135a, 0x1380, 0x138f, - 0x13a0, 0x13f4, + 0x13a0, 0x13f5, + 0x13f8, 0x13fd, 0x1401, 0x166c, 0x166f, 0x167f, 0x1681, 0x169a, @@ -295,14 +307,15 @@ 0x1760, 0x176c, 0x176e, 0x1770, 0x1780, 0x17b3, - 0x1820, 0x1877, - 0x1880, 0x18a8, + 0x1820, 0x1878, + 0x1880, 0x1884, + 0x1887, 0x18a8, 0x18b0, 0x18f5, 0x1900, 0x191e, 0x1950, 0x196d, 0x1970, 0x1974, 0x1980, 0x19ab, - 0x19c1, 0x19c7, + 0x19b0, 0x19c9, 0x1a00, 0x1a16, 0x1a20, 0x1a54, 0x1b05, 0x1b33, @@ -313,8 +326,11 @@ 0x1c00, 0x1c23, 0x1c4d, 0x1c4f, 0x1c5a, 0x1c7d, + 0x1c80, 0x1c88, + 0x1c90, 0x1cba, + 0x1cbd, 0x1cbf, 0x1ce9, 0x1cec, - 0x1cee, 0x1cf1, + 0x1cee, 0x1cf3, 0x1cf5, 0x1cf6, 0x1d00, 0x1dbf, 0x1e00, 0x1f15, @@ -363,12 +379,12 @@ 0x309d, 0x309f, 0x30a1, 0x30fa, 0x30fc, 0x30ff, - 0x3105, 0x312d, + 0x3105, 0x312f, 0x3131, 0x318e, - 0x31a0, 0x31ba, + 0x31a0, 0x31bf, 0x31f0, 0x31ff, - 0x3400, 0x4db5, - 0x4e00, 0x9fcc, + 0x3400, 0x4dbf, + 0x4e00, 0x9ffc, 0xa000, 0xa48c, 0xa4d0, 0xa4fd, 0xa500, 0xa60c, @@ -379,16 +395,16 @@ 0xa6a0, 0xa6e5, 0xa717, 0xa71f, 0xa722, 0xa788, - 0xa78b, 0xa78e, - 0xa790, 0xa7ad, - 0xa7b0, 0xa7b1, - 0xa7f7, 0xa801, + 0xa78b, 0xa7bf, + 0xa7c2, 0xa7ca, + 0xa7f5, 0xa801, 0xa803, 0xa805, 0xa807, 0xa80a, 0xa80c, 0xa822, 0xa840, 0xa873, 0xa882, 0xa8b3, 0xa8f2, 0xa8f7, + 0xa8fd, 0xa8fe, 0xa90a, 0xa925, 0xa930, 0xa946, 0xa960, 0xa97c, @@ -412,9 +428,8 @@ 0xab20, 0xab26, 0xab28, 0xab2e, 0xab30, 0xab5a, - 0xab5c, 0xab5f, - 0xab64, 0xab65, - 0xabc0, 0xabe2, + 0xab5c, 0xab69, + 0xab70, 0xabe2, 0xac00, 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, 0xd7fb, @@ -451,13 +466,15 @@ 0x10280, 0x1029c, 0x102a0, 0x102d0, 0x10300, 0x1031f, - 0x10330, 0x10340, + 0x1032d, 0x10340, 0x10342, 0x10349, 0x10350, 0x10375, 0x10380, 0x1039d, 0x103a0, 0x103c3, 0x103c8, 0x103cf, 0x10400, 0x1049d, + 0x104b0, 0x104d3, + 0x104d8, 0x104fb, 0x10500, 0x10527, 0x10530, 0x10563, 0x10600, 0x10736, @@ -469,13 +486,15 @@ 0x1083f, 0x10855, 0x10860, 0x10876, 0x10880, 0x1089e, + 0x108e0, 0x108f2, + 0x108f4, 0x108f5, 0x10900, 0x10915, 0x10920, 0x10939, 0x10980, 0x109b7, 0x109be, 0x109bf, 0x10a10, 0x10a13, 0x10a15, 0x10a17, - 0x10a19, 0x10a33, + 0x10a19, 0x10a35, 0x10a60, 0x10a7c, 0x10a80, 0x10a9c, 0x10ac0, 0x10ac7, @@ -485,6 +504,15 @@ 0x10b60, 0x10b72, 0x10b80, 0x10b91, 0x10c00, 0x10c48, + 0x10c80, 0x10cb2, + 0x10cc0, 0x10cf2, + 0x10d00, 0x10d23, + 0x10e80, 0x10ea9, + 0x10eb0, 0x10eb1, + 0x10f00, 0x10f1c, + 0x10f30, 0x10f45, + 0x10fb0, 0x10fc4, + 0x10fe0, 0x10ff6, 0x11003, 0x11037, 0x11083, 0x110af, 0x110d0, 0x110e8, @@ -494,6 +522,10 @@ 0x111c1, 0x111c4, 0x11200, 0x11211, 0x11213, 0x1122b, + 0x11280, 0x11286, + 0x1128a, 0x1128d, + 0x1128f, 0x1129d, + 0x1129f, 0x112a8, 0x112b0, 0x112de, 0x11305, 0x1130c, 0x1130f, 0x11310, @@ -502,15 +534,41 @@ 0x11332, 0x11333, 0x11335, 0x11339, 0x1135d, 0x11361, + 0x11400, 0x11434, + 0x11447, 0x1144a, + 0x1145f, 0x11461, 0x11480, 0x114af, 0x114c4, 0x114c5, 0x11580, 0x115ae, + 0x115d8, 0x115db, 0x11600, 0x1162f, 0x11680, 0x116aa, + 0x11700, 0x1171a, + 0x11800, 0x1182b, 0x118a0, 0x118df, + 0x118ff, 0x11906, + 0x1190c, 0x11913, + 0x11915, 0x11916, + 0x11918, 0x1192f, + 0x119a0, 0x119a7, + 0x119aa, 0x119d0, + 0x11a0b, 0x11a32, + 0x11a5c, 0x11a89, 0x11ac0, 0x11af8, - 0x12000, 0x12398, + 0x11c00, 0x11c08, + 0x11c0a, 0x11c2e, + 0x11c72, 0x11c8f, + 0x11d00, 0x11d06, + 0x11d08, 0x11d09, + 0x11d0b, 0x11d30, + 0x11d60, 0x11d65, + 0x11d67, 0x11d68, + 0x11d6a, 0x11d89, + 0x11ee0, 0x11ef2, + 0x12000, 0x12399, + 0x12480, 0x12543, 0x13000, 0x1342e, + 0x14400, 0x14646, 0x16800, 0x16a38, 0x16a40, 0x16a5e, 0x16ad0, 0x16aed, @@ -518,9 +576,17 @@ 0x16b40, 0x16b43, 0x16b63, 0x16b77, 0x16b7d, 0x16b8f, - 0x16f00, 0x16f44, + 0x16e40, 0x16e7f, + 0x16f00, 0x16f4a, 0x16f93, 0x16f9f, - 0x1b000, 0x1b001, + 0x16fe0, 0x16fe1, + 0x17000, 0x187f7, + 0x18800, 0x18cd5, + 0x18d00, 0x18d08, + 0x1b000, 0x1b11e, + 0x1b150, 0x1b152, + 0x1b164, 0x1b167, + 0x1b170, 0x1b2fb, 0x1bc00, 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, 0x1bc88, @@ -552,7 +618,11 @@ 0x1d78a, 0x1d7a8, 0x1d7aa, 0x1d7c2, 0x1d7c4, 0x1d7cb, + 0x1e100, 0x1e12c, + 0x1e137, 0x1e13d, + 0x1e2c0, 0x1e2eb, 0x1e800, 0x1e8c4, + 0x1e900, 0x1e943, 0x1ee00, 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, 0x1ee22, @@ -570,10 +640,13 @@ 0x1eea1, 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, 0x1eebb, - 0x20000, 0x2a6d6, + 0x20000, 0x2a6dd, 0x2a700, 0x2b734, 0x2b740, 0x2b81d, + 0x2b820, 0x2cea1, + 0x2ceb0, 0x2ebe0, 0x2f800, 0x2fa1d, + 0x30000, 0x3134a, }; static const uint32_t isalphas[] = { @@ -599,25 +672,25 @@ 0x09b2, 0x09bd, 0x09ce, + 0x09fc, 0x0a5e, 0x0abd, 0x0ad0, + 0x0af9, 0x0b3d, 0x0b71, 0x0b83, 0x0b9c, 0x0bd0, 0x0c3d, + 0x0c80, 0x0cbd, 0x0cde, 0x0d3d, 0x0d4e, 0x0dbd, 0x0e84, - 0x0e8a, - 0x0e8d, 0x0ea5, - 0x0ea7, 0x0ebd, 0x0ec6, 0x0f00, @@ -632,6 +705,7 @@ 0x17dc, 0x18aa, 0x1aa7, + 0x1cfa, 0x1f59, 0x1f5b, 0x1f5d, @@ -660,16 +734,38 @@ 0x10808, 0x1083c, 0x10a00, + 0x10f27, + 0x11144, + 0x11147, 0x11176, 0x111da, + 0x111dc, + 0x11288, 0x1133d, + 0x11350, 0x114c7, 0x11644, - 0x118ff, + 0x116b8, + 0x11909, + 0x1193f, + 0x11941, + 0x119e1, + 0x119e3, + 0x11a00, + 0x11a3a, + 0x11a50, + 0x11a9d, + 0x11c40, + 0x11d46, + 0x11d98, + 0x11fb0, 0x16f50, + 0x16fe3, 0x1d4a2, 0x1d4bb, 0x1d546, + 0x1e14e, + 0x1e94b, 0x1ee24, 0x1ee27, 0x1ee39, @@ -688,7 +784,7 @@ 0x1ee7e, }; -bool +int uni_isalpha(uint32_t c) { const uint32_t *p; @@ -696,14 +792,14 @@ p = search(c, isalphar, nelem (isalphar) / 2, 2); if (p && c >= p[0] && c <= p[1]) - return true; + return 1; p = search(c, isalphas, nelem (isalphas), 1); if (p && c == p[0]) - return true; + return 1; - return false; + return 0; } static const uint32_t isupperr[] = { @@ -737,6 +833,9 @@ 0x04c0, 0x04c1, 0x0531, 0x0556, 0x10a0, 0x10c5, + 0x13a0, 0x13f5, + 0x1c90, 0x1cba, + 0x1cbd, 0x1cbf, 0x1f08, 0x1f0f, 0x1f18, 0x1f1d, 0x1f28, 0x1f2f, @@ -764,11 +863,15 @@ 0x2c6d, 0x2c70, 0x2c7e, 0x2c80, 0xa77d, 0xa77e, - 0xa7aa, 0xa7ad, - 0xa7b0, 0xa7b1, + 0xa7aa, 0xa7ae, + 0xa7b0, 0xa7b4, + 0xa7c4, 0xa7c7, 0xff21, 0xff3a, 0x10400, 0x10427, + 0x104b0, 0x104d3, + 0x10c80, 0x10cb2, 0x118a0, 0x118bf, + 0x16e40, 0x16e5f, 0x1d400, 0x1d419, 0x1d434, 0x1d44d, 0x1d468, 0x1d481, @@ -796,6 +899,7 @@ 0x1d71c, 0x1d734, 0x1d756, 0x1d76e, 0x1d790, 0x1d7a8, + 0x1e900, 0x1e921, }; static const uint32_t isuppers[] = { @@ -1333,13 +1437,21 @@ 0xa7a4, 0xa7a6, 0xa7a8, + 0xa7b6, + 0xa7b8, + 0xa7ba, + 0xa7bc, + 0xa7be, + 0xa7c2, + 0xa7c9, + 0xa7f5, 0x1d49c, 0x1d4a2, 0x1d546, 0x1d7ca, }; -bool +int uni_isupper(uint32_t c) { const uint32_t *p; @@ -1347,14 +1459,14 @@ p = search(c, isupperr, nelem (isupperr) / 2, 2); if (p && c >= p[0] && c <= p[1]) - return true; + return 1; p = search(c, isuppers, nelem (isuppers), 1); if (p && c == p[0]) - return true; + return 1; - return false; + return 0; } static const uint32_t islowerr[] = { @@ -1383,7 +1495,11 @@ 0x03fb, 0x03fc, 0x0430, 0x045f, 0x04ce, 0x04cf, - 0x0561, 0x0587, + 0x0560, 0x0588, + 0x10d0, 0x10fa, + 0x10fd, 0x10ff, + 0x13f8, 0x13fd, + 0x1c80, 0x1c88, 0x1d00, 0x1d2b, 0x1d6b, 0x1d77, 0x1d79, 0x1d9a, @@ -1423,12 +1539,16 @@ 0xa771, 0xa778, 0xa793, 0xa795, 0xab30, 0xab5a, - 0xab64, 0xab65, + 0xab60, 0xab68, + 0xab70, 0xabbf, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xff41, 0xff5a, 0x10428, 0x1044f, + 0x104d8, 0x104fb, + 0x10cc0, 0x10cf2, 0x118c0, 0x118df, + 0x16e60, 0x16e7f, 0x1d41a, 0x1d433, 0x1d44e, 0x1d454, 0x1d456, 0x1d467, @@ -1455,6 +1575,7 @@ 0x1d78a, 0x1d78f, 0x1d7aa, 0x1d7c2, 0x1d7c4, 0x1d7c9, + 0x1e922, 0x1e943, }; static const uint32_t islowers[] = { @@ -1985,12 +2106,23 @@ 0xa7a5, 0xa7a7, 0xa7a9, + 0xa7af, + 0xa7b5, + 0xa7b7, + 0xa7b9, + 0xa7bb, + 0xa7bd, + 0xa7bf, + 0xa7c3, + 0xa7c8, + 0xa7ca, + 0xa7f6, 0xa7fa, 0x1d4bb, 0x1d7cb, }; -bool +int uni_islower(uint32_t c) { const uint32_t *p; @@ -1998,14 +2130,14 @@ p = search(c, islowerr, nelem (islowerr) / 2, 2); if (p && c >= p[0] && c <= p[1]) - return true; + return 1; p = search(c, islowers, nelem (islowers), 1); if (p && c == p[0]) - return true; + return 1; - return false; + return 0; } static const uint32_t istitler[] = { @@ -2038,6 +2170,7 @@ 0x04c0, 0x04c1, 0x0531, 0x0556, 0x10a0, 0x10c5, + 0x13a0, 0x13f5, 0x1f08, 0x1f0f, 0x1f18, 0x1f1d, 0x1f28, 0x1f2f, @@ -2059,11 +2192,16 @@ 0x2c6d, 0x2c70, 0x2c7e, 0x2c80, 0xa77d, 0xa77e, - 0xa7aa, 0xa7ad, - 0xa7b0, 0xa7b1, + 0xa7aa, 0xa7ae, + 0xa7b0, 0xa7b4, + 0xa7c4, 0xa7c7, 0xff21, 0xff3a, 0x10400, 0x10427, + 0x104b0, 0x104d3, + 0x10c80, 0x10cb2, 0x118a0, 0x118bf, + 0x16e40, 0x16e5f, + 0x1e900, 0x1e921, }; static const uint32_t istitles[] = { @@ -2592,9 +2730,17 @@ 0xa7a4, 0xa7a6, 0xa7a8, + 0xa7b6, + 0xa7b8, + 0xa7ba, + 0xa7bc, + 0xa7be, + 0xa7c2, + 0xa7c9, + 0xa7f5, }; -bool +int uni_istitle(uint32_t c) { const uint32_t *p; @@ -2602,14 +2748,14 @@ p = search(c, istitler, nelem (istitler) / 2, 2); if (p && c >= p[0] && c <= p[1]) - return true; + return 1; p = search(c, istitles, nelem (istitles), 1); if (p && c == p[0]) - return true; + return 1; - return false; + return 0; } static const uint32_t toupperr[] = { @@ -2627,6 +2773,10 @@ 0x0430, 0x044f, 1048544, 0x0450, 0x045f, 1048496, 0x0561, 0x0586, 1048528, + 0x10d0, 0x10fa, 1051584, + 0x10fd, 0x10ff, 1051584, + 0x13f8, 0x13fd, 1048568, + 0x1c83, 0x1c84, 1042334, 0x1f00, 0x1f07, 1048584, 0x1f10, 0x1f15, 1048584, 0x1f20, 0x1f27, 1048584, @@ -2649,9 +2799,14 @@ 0x24d0, 0x24e9, 1048550, 0x2c30, 0x2c5e, 1048528, 0x2d00, 0x2d25, 1041312, + 0xab70, 0xabbf, 1009712, 0xff41, 0xff5a, 1048544, 0x10428, 0x1044f, 1048536, + 0x104d8, 0x104fb, 1048536, + 0x10cc0, 0x10cf2, 1048512, 0x118c0, 0x118df, 1048544, + 0x16e60, 0x16e7f, 1048544, + 0x1e922, 0x1e943, 1048542, }; static const uint32_t touppers[] = { @@ -2819,6 +2974,7 @@ 0x0266, 1090884, 0x0268, 1048367, 0x0269, 1048365, + 0x026a, 1090884, 0x026b, 1059319, 0x026c, 1090881, 0x026f, 1048365, @@ -2827,12 +2983,14 @@ 0x0275, 1048362, 0x027d, 1059303, 0x0280, 1048358, + 0x0282, 1090883, 0x0283, 1048358, 0x0287, 1090858, 0x0288, 1048358, 0x0289, 1048507, 0x028c, 1048505, 0x0292, 1048357, + 0x029d, 1090837, 0x029e, 1090834, 0x0345, 1048660, 0x0371, 1048575, @@ -2965,8 +3123,16 @@ 0x052b, 1048575, 0x052d, 1048575, 0x052f, 1048575, + 0x1c80, 1042322, + 0x1c81, 1042323, + 0x1c82, 1042332, + 0x1c85, 1042333, + 0x1c86, 1042340, + 0x1c87, 1042395, + 0x1c88, 1083842, 0x1d79, 1083908, 0x1d7d, 1052390, + 0x1d8e, 1083960, 0x1e01, 1048575, 0x1e03, 1048575, 0x1e05, 1048575, @@ -3250,6 +3416,7 @@ 0xa78c, 1048575, 0xa791, 1048575, 0xa793, 1048575, + 0xa794, 1048624, 0xa797, 1048575, 0xa799, 1048575, 0xa79b, 1048575, @@ -3260,6 +3427,17 @@ 0xa7a5, 1048575, 0xa7a7, 1048575, 0xa7a9, 1048575, + 0xa7b5, 1048575, + 0xa7b7, 1048575, + 0xa7b9, 1048575, + 0xa7bb, 1048575, + 0xa7bd, 1048575, + 0xa7bf, 1048575, + 0xa7c3, 1048575, + 0xa7c8, 1048575, + 0xa7ca, 1048575, + 0xa7f6, 1048575, + 0xab53, 1047648, }; uint32_t @@ -3295,6 +3473,10 @@ 0x0410, 0x042f, 1048608, 0x0531, 0x0556, 1048624, 0x10a0, 0x10c5, 1055840, + 0x13a0, 0x13ef, 1087440, + 0x13f0, 0x13f5, 1048584, + 0x1c90, 0x1cba, 1045568, + 0x1cbd, 0x1cbf, 1045568, 0x1f08, 0x1f0f, 1048568, 0x1f18, 0x1f1d, 1048568, 0x1f28, 0x1f2f, 1048568, @@ -3319,7 +3501,11 @@ 0x2c7e, 0x2c7f, 1037761, 0xff21, 0xff3a, 1048608, 0x10400, 0x10427, 1048616, + 0x104b0, 0x104d3, 1048616, + 0x10c80, 0x10cb2, 1048640, 0x118a0, 0x118bf, 1048608, + 0x16e40, 0x16e5f, 1048608, + 0x1e900, 0x1e921, 1048610, }; static const uint32_t tolowers[] = { @@ -3918,8 +4104,24 @@ 0xa7ab, 1006257, 0xa7ac, 1006261, 0xa7ad, 1006271, + 0xa7ae, 1006268, 0xa7b0, 1006318, 0xa7b1, 1006294, + 0xa7b2, 1006315, + 0xa7b3, 1049504, + 0xa7b4, 1048577, + 0xa7b6, 1048577, + 0xa7b8, 1048577, + 0xa7ba, 1048577, + 0xa7bc, 1048577, + 0xa7be, 1048577, + 0xa7c2, 1048577, + 0xa7c4, 1048528, + 0xa7c5, 1006269, + 0xa7c6, 1013192, + 0xa7c7, 1048577, + 0xa7c9, 1048577, + 0xa7f5, 1048577, }; uint32_t @@ -3955,6 +4157,8 @@ 0x0430, 0x044f, 1048544, 0x0450, 0x045f, 1048496, 0x0561, 0x0586, 1048528, + 0x13f8, 0x13fd, 1048568, + 0x1c83, 0x1c84, 1042334, 0x1f00, 0x1f07, 1048584, 0x1f10, 0x1f15, 1048584, 0x1f20, 0x1f27, 1048584, @@ -3977,9 +4181,14 @@ 0x24d0, 0x24e9, 1048550, 0x2c30, 0x2c5e, 1048528, 0x2d00, 0x2d25, 1041312, + 0xab70, 0xabbf, 1009712, 0xff41, 0xff5a, 1048544, 0x10428, 0x1044f, 1048536, + 0x104d8, 0x104fb, 1048536, + 0x10cc0, 0x10cf2, 1048512, 0x118c0, 0x118df, 1048544, + 0x16e60, 0x16e7f, 1048544, + 0x1e922, 0x1e943, 1048542, }; static const uint32_t totitles[] = { @@ -4147,6 +4356,7 @@ 0x0266, 1090884, 0x0268, 1048367, 0x0269, 1048365, + 0x026a, 1090884, 0x026b, 1059319, 0x026c, 1090881, 0x026f, 1048365, @@ -4155,12 +4365,14 @@ 0x0275, 1048362, 0x027d, 1059303, 0x0280, 1048358, + 0x0282, 1090883, 0x0283, 1048358, 0x0287, 1090858, 0x0288, 1048358, 0x0289, 1048507, 0x028c, 1048505, 0x0292, 1048357, + 0x029d, 1090837, 0x029e, 1090834, 0x0345, 1048660, 0x0371, 1048575, @@ -4293,8 +4505,16 @@ 0x052b, 1048575, 0x052d, 1048575, 0x052f, 1048575, + 0x1c80, 1042322, + 0x1c81, 1042323, + 0x1c82, 1042332, + 0x1c85, 1042333, + 0x1c86, 1042340, + 0x1c87, 1042395, + 0x1c88, 1083842, 0x1d79, 1083908, 0x1d7d, 1052390, + 0x1d8e, 1083960, 0x1e01, 1048575, 0x1e03, 1048575, 0x1e05, 1048575, @@ -4578,6 +4798,7 @@ 0xa78c, 1048575, 0xa791, 1048575, 0xa793, 1048575, + 0xa794, 1048624, 0xa797, 1048575, 0xa799, 1048575, 0xa79b, 1048575, @@ -4588,6 +4809,17 @@ 0xa7a5, 1048575, 0xa7a7, 1048575, 0xa7a9, 1048575, + 0xa7b5, 1048575, + 0xa7b7, 1048575, + 0xa7b9, 1048575, + 0xa7bb, 1048575, + 0xa7bd, 1048575, + 0xa7bf, 1048575, + 0xa7c3, 1048575, + 0xa7c8, 1048575, + 0xa7ca, 1048575, + 0xa7f6, 1048575, + 0xab53, 1047648, }; uint32_t
--- a/irccd/unicode.h Tue Feb 09 22:03:07 2021 +0100 +++ b/irccd/unicode.h Tue Feb 09 22:31:53 2021 +0100 @@ -1,7 +1,7 @@ /* * unicode.h -- UTF-8 to UTF-32 conversions and various operations * - * Copyright (c) 2013-2020 David Demelier <markand@malikania.fr> + * Copyright (c) 2013-2021 David Demelier <markand@malikania.fr> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,56 +16,55 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef IRCCD_UNICODE_H -#define IRCCD_UNICODE_H +#ifndef UNICODE_H +#define UNICODE_H -#include <stdbool.h> #include <stddef.h> #include <stdint.h> size_t -uni8_encode(uint8_t dst[], size_t dstsz, uint32_t point); +uni8_encode(uint8_t *dst, size_t dstsz, uint32_t point); size_t -uni8_decode(const uint8_t src[], uint32_t *point); +uni8_decode(const uint8_t *src, uint32_t *point); size_t uni8_sizeof(uint8_t c); size_t -uni8_length(const uint8_t src[]); +uni8_length(const uint8_t *src); size_t -uni8_to32(const uint8_t src[], uint32_t dst[], size_t dstsz); +uni8_to32(const uint8_t *src, uint32_t *dst, size_t dstsz); size_t uni32_sizeof(uint32_t point); size_t -uni32_length(const uint32_t src[]); +uni32_length(const uint32_t *src); size_t -uni32_requires(const uint32_t src[]); +uni32_requires(const uint32_t *src); size_t -uni32_to8(const uint32_t src[], uint8_t dst[], size_t dstsz); +uni32_to8(const uint32_t *src, uint8_t *dst, size_t dstsz); -bool +int uni_isalpha(uint32_t c); -bool +int uni_isdigit(uint32_t c); -bool +int uni_islower(uint32_t c); -bool +int uni_isspace(uint32_t c); -bool +int uni_istitle(uint32_t c); -bool +int uni_isupper(uint32_t c); uint32_t @@ -77,4 +76,4 @@ uint32_t uni_totitle(uint32_t c); -#endif /* !IRCCD_UNICODE_H */ +#endif // !UNICODE_H