Let's use unencoded constants.

This commit is contained in:
casey langen 2022-12-21 17:36:58 -08:00
parent 0053d58a32
commit 2ea2ddb0ef

View File

@ -68,65 +68,65 @@ typedef UINT32_TYPE u32; /* 4-byte unsigned integer */
/* mappings from ASCII characters to a list of their respective accented /* mappings from ASCII characters to a list of their respective accented
characters. both case sensitive and insensitive versions are supplied here. */ characters. both case sensitive and insensitive versions are supplied here. */
static std::unordered_map<u32, const char*> charToAccentsInsensitive = { static std::unordered_map<u32, const char*> charToAccentsInsensitive = {
{ (u32)'a', u8"Aa\xe0\xe1\xe2\xe3\xe4\xe5\x101\x103\x105\xc0\xc1\xc2\xc3\xc4\xc5\x100\x102\x104" }, { (u32)'a', u8"AaàáâãäåāăąÀÁÂÃÄÅĀĂĄ" },
{ (u32)'c', u8"Cc\xe7\x107\x109\x10b\x10d\xc7\x106\x108\x10a\x10c" }, { (u32)'c', u8"CcçćĉċčÇĆĈĊČ" },
{ (u32)'d', u8"Dd\x10f\x111\x10e\x110" }, { (u32)'d', u8"DdďđĎĐ" },
{ (u32)'e', u8"Ee\xe8\xe9\xea\xeb\x113\x115\x117\x119\x11b\xc8\xc9\xca\xcb\x112\x114\x116\x118\x11a" }, { (u32)'e', u8"EeèéêëēĕėęěÈÉÊËĒĔĖĘĚ" },
{ (u32)'g', u8"Gg\x11d\x11f\x121\x123\x11c\x11e\x120\x122" }, { (u32)'g', u8"GgĝğġģĜĞĠĢ" },
{ (u32)'h', u8"Hh\x125\x127\x124\x126" }, { (u32)'h', u8"HhĥħĤĦ" },
{ (u32)'i', u8"Ii\xec\xed\xee\xef\x129\x12b\x12d\x12f\x131\xcc\xcd\xce\xcf\x128\x12a\x12c\x12e\x130" }, { (u32)'i', u8"IiìíîïĩīĭįıÌÍÎÏĨĪĬĮİ" },
{ (u32)'j', u8"Jj\x135\x134" }, { (u32)'j', u8"JjĵĴ" },
{ (u32)'k', u8"Kk\x137\x138\x136" }, { (u32)'k', u8"KkķĸĶ" },
{ (u32)'l', u8"Ll\x13a\x13c\x13e\x140\x142\x139\x13b\x13d\x13f\x141" }, { (u32)'l', u8"LlĺļľŀłĹĻĽĿŁ" },
{ (u32)'n', u8"Nn\xf1\x144\x146\x148\x14a\xd1\x143\x145\x147\x149\x14b" }, { (u32)'n', u8"NnñńņňŊÑŃŅŇʼnŋ" },
{ (u32)'o', u8"Oo\xf2\xf3\xf4\xf5\xf6\xf9\xfa\xfb\xfc\x14d\x14f\x151\xd2\xd3\xd4\xd5\xd6\x14c\x14e\x150" }, { (u32)'o', u8"OoòóôõöùúûüōŏőÒÓÔÕÖŌŎŐ" },
{ (u32)'r', u8"Rr\x155\x157\x159\x154\x156\x158" }, { (u32)'r', u8"RrŕŗřŔŖŘ" },
{ (u32)'s', u8"Ss\x15b\x15d\x15f\x161\x17f\xdf" }, { (u32)'s', u8"Ssśŝşšſß" },
{ (u32)'t', u8"Tt\x163\x165\x167\x162\x164\x166" }, { (u32)'t', u8"TtţťŧŢŤŦ" },
{ (u32)'u', u8"Uu\x169\x16b\x16d\x16f\x171\x173\xd9\xda\xdb\xdc\x168\x16a\x16c\x16e\x170\x172" }, { (u32)'u', u8"UuũūŭůűųÙÚÛÜŨŪŬŮŰŲ" },
{ (u32)'w', u8"Ww\x175\x174" }, { (u32)'w', u8"WwŵŴ" },
{ (u32)'y', u8"Yy\xfd\xff\x177\xdd\x176\x178" }, { (u32)'y', u8"YyýÿŷÝŶŸ" },
{ (u32)'z', u8"Zz\x179\x17b\x17d" }, { (u32)'z', u8"ZzŹŻŽ" },
}; };
static std::unordered_map<u32, const char*> charToAccentsSensitive = { static std::unordered_map<u32, const char*> charToAccentsSensitive = {
{ (u32)'A', u8"A\xc0\xc1\xc2\xc3\xc4\xc5\x100\x102\x104" }, { (u32)'A', u8"AÀÁÂÃÄÅĀĂĄ" },
{ (u32)'C', u8"C\xc7\x106\x108\x10a\x10c" }, { (u32)'C', u8"CÇĆĈĊČ" },
{ (u32)'D', u8"D\x10e\x110" }, { (u32)'D', u8"DĎĐ" },
{ (u32)'E', u8"E\xc8\xc9\xca\xcb\x112\x114\x116\x118\x11a" }, { (u32)'E', u8"EÈÉÊËĒĔĖĘĚ" },
{ (u32)'G', u8"G\x11c\x11e\x120\x122" }, { (u32)'G', u8"GĜĞĠĢ" },
{ (u32)'H', u8"H\x124\x126" }, { (u32)'H', u8"HĤĦ" },
{ (u32)'I', u8"I\xcc\xcd\xce\xcf\x128\x12a\x12c\x12e\x130" }, { (u32)'I', u8"IÌÍÎÏĨĪĬĮİ" },
{ (u32)'J', u8"J\x134" }, { (u32)'J', u8"JĴ" },
{ (u32)'K', u8"K\x136" }, { (u32)'K', u8"KĶ" },
{ (u32)'L', u8"L\x139\x13b\x13d\x13f\x141" }, { (u32)'L', u8"LĹĻĽĿŁ" },
{ (u32)'N', u8"N\xd1\x143\x145\x147\x149\x14b" }, { (u32)'N', u8"NÑŃŅŇʼnŋ" },
{ (u32)'O', u8"O\xd2\xd3\xd4\xd5\xd6\x14c\x14e\x150" }, { (u32)'O', u8"OÒÓÔÕÖŌŎŐ" },
{ (u32)'R', u8"R\x154\x156\x158" }, { (u32)'R', u8"RŔŖŘ" },
{ (u32)'S', u8"S\xdf" }, { (u32)'S', u8"Sß" },
{ (u32)'T', u8"T\x162\x164\x166" }, { (u32)'T', u8"TŢŤŦ" },
{ (u32)'U', u8"U\xd9\xda\xdb\xdc\x168\x16a\x16c\x16e\x170\x172" }, { (u32)'U', u8"UÙÚÛÜŨŪŬŮŰŲ" },
{ (u32)'W', u8"W\x174" }, { (u32)'W', u8"WŴ" },
{ (u32)'Y', u8"Y\xdd\x176\x178" }, { (u32)'Y', u8"YÝŶŸ" },
{ (u32)'Z', u8"Z\x179\x17b\x17d" }, { (u32)'Z', u8"ZŹŻŽ" },
{ (u32)'a', u8"a\xe0\xe1\xe2\xe3\xe4\xe5\x101\x103\x105" }, { (u32)'a', u8"aàáâãäåāăą" },
{ (u32)'c', u8"c\xe7\x107\x109\x10b\x10d" }, { (u32)'c', u8"cçćĉċč" },
{ (u32)'d', u8"d\x10f\x111" }, { (u32)'d', u8"dďđ" },
{ (u32)'e', u8"e\xe8\xe9\xea\xeb\x113\x115\x117\x119\x11b" }, { (u32)'e', u8"eèéêëēĕėęě" },
{ (u32)'g', u8"g\x11d\x11f\x121\x123" }, { (u32)'g', u8"gĝğġģ" },
{ (u32)'h', u8"h\x125\x127" }, { (u32)'h', u8"hĥħ" },
{ (u32)'i', u8"i\xec\xed\xee\xef\x129\x12b\x12d\x12f\x131" }, { (u32)'i', u8"iìíîïĩīĭįı" },
{ (u32)'j', u8"j\x135" }, { (u32)'j', u8"jĵ" },
{ (u32)'k', u8"k\x137\x138" }, { (u32)'k', u8"kķĸ" },
{ (u32)'l', u8"l\x13a\x13c\x13e\x140\x142" }, { (u32)'l', u8"lĺļľŀł" },
{ (u32)'n', u8"n\xf1\x144\x146\x148\x14a" }, { (u32)'n', u8"nñńņňŊ" },
{ (u32)'o', u8"o\xf2\xf3\xf4\xf5\xf6\xf9\xfa\xfb\xfc\x14d\x14f\x151" }, { (u32)'o', u8"oòóôõöùúûüōŏő" },
{ (u32)'r', u8"r\x155\x157\x159" }, { (u32)'r', u8"rŕŗř" },
{ (u32)'s', u8"s\x15b\x15d\x15f\x161\x17f" }, { (u32)'s', u8"sśŝşšſ" },
{ (u32)'t', u8"t\x163\x165\x167" }, { (u32)'t', u8"tţťŧ" },
{ (u32)'u', u8"u\x169\x16b\x16d\x16f\x171\x173" }, { (u32)'u', u8"uũūŭůűų" },
{ (u32)'w', u8"w\x175" }, { (u32)'w', u8"wŵ" },
{ (u32)'y', u8"y\xfd\xff\x177" }, { (u32)'y', u8"yýÿŷ" },
}; };
/* /*