+ for (u32 i = 0; i < 65536; i++)
+ upcase[i] = i;
+
+ for (u32 r = 0; r < ARRAY_LEN(uc_run_table); r++)
+ for (u32 i = uc_run_table[r][0]; i < uc_run_table[r][1]; i++)
+ upcase[i] = i + uc_run_table[r][2];
+
+ for (u32 r = 0; r < ARRAY_LEN(uc_dup_table); r++)
+ for (u32 i = uc_dup_table[r][0]; i < uc_dup_table[r][1]; i += 2)
+ upcase[i + 1] = i;
+
+ for (u32 r = 0; r < ARRAY_LEN(uc_byte_table); r++)
+ upcase[uc_byte_table[r][0]] = uc_byte_table[r][1];
+
+#if 0
+ /* Sanity checks */
+ wimlib_assert(upcase['a'] == 'A');
+ wimlib_assert(upcase['A'] == 'A');
+ wimlib_assert(upcase['z'] == 'Z');
+ wimlib_assert(upcase['Z'] == 'Z');
+ wimlib_assert(upcase['1'] == '1');
+ wimlib_assert(upcase[0x00e9] == 0x00c9); /* Latin letter e, with acute accent */
+ wimlib_assert(upcase[0x00c9] == 0x00c9);
+ wimlib_assert(upcase[0x03c1] == 0x03a1); /* Greek letter rho */
+ wimlib_assert(upcase[0x03a1] == 0x03a1);
+ wimlib_assert(upcase[0x0436] == 0x0416); /* Cyrillic letter zhe */
+ wimlib_assert(upcase[0x0416] == 0x0416);
+ wimlib_assert(upcase[0x0567] == 0x0537); /* Armenian letter eh */
+ wimlib_assert(upcase[0x0537] == 0x0537);
+ wimlib_assert(upcase[0x24d0] == 0x24b6); /* Circled Latin letter A
+ (is that a real character???) */
+ wimlib_assert(upcase[0x24b6] == 0x24b6);
+ wimlib_assert(upcase[0x2603] == 0x2603); /* Note to self: Upper case
+ snowman symbol does not
+ exist. */
+#endif