Skip to content

Commit

Permalink
Update wide/zero-character width tables from Unicode 15.1.0 to 16.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-Gray committed Dec 11, 2024
1 parent 7ff555a commit a5f13c2
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 68 deletions.
4 changes: 2 additions & 2 deletions curses.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Defined by this header:
#define PDC_VER_MINOR 4
#define PDC_VER_CHANGE 0
#define PDC_VER_YEAR 2024
#define PDC_VER_MONTH 10
#define PDC_VER_DAY 28
#define PDC_VER_MONTH 12
#define PDC_VER_DAY 11

#define PDC_STRINGIZE( x) #x
#define PDC_stringize( x) PDC_STRINGIZE( x)
Expand Down
136 changes: 70 additions & 66 deletions pdcurses/addch.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ For PDCursesMod, only PDC_wcwidth is used, modified to take an
int argument instead of wchar_t, because in MS-land, wchar_t
is 16 bits; getting the full Unicode range requires 21 bits.
Also modified format/indenting to conform to PDCurses norms,
and (January 2024) updated from Unicode 5.0 to 15.1.0. See
and (December 2024) updated from Unicode 5.0 to 16.0.0. See
uni_tbl.c in the Bill-Gray/junk repository.
Following function modified from one in the README.md at
Expand Down Expand Up @@ -210,7 +210,7 @@ PDCEX int PDC_wcwidth( const int32_t ucs)
/* see 'uni_tbl.c' in the Bill-Gray/junk repo */
const uint16_t tbl_for_zero_width_chars[][2] = {
{ /* plane 0 */ 0, 202 },
{ /* plane 1 */ 202, 321 },
{ /* plane 1 */ 202, 333 },
{ /* plane 2 */ 0, 0 },
{ /* plane 3 */ 0, 0 },
{ /* plane 4 */ 0, 0 },
Expand All @@ -223,7 +223,7 @@ const uint16_t tbl_for_zero_width_chars[][2] = {
{ /* plane 11 */ 0, 0 },
{ /* plane 12 */ 0, 0 },
{ /* plane 13 */ 0, 0 },
{ /* plane 14 */ 321, 322 },
{ /* plane 14 */ 333, 334 },
{ /* plane 15 */ 0, 0 },
{ /* plane 16 */ 0, 0 },
{ 0x00AD, 0x036F }, { 0x0483, 0x0489 }, { 0x0591, 0x05BD },
Expand Down Expand Up @@ -295,51 +295,55 @@ const uint16_t tbl_for_zero_width_chars[][2] = {
{ 0xFE00, 0xFE0F }, { 0xFE20, 0xFE2F }, { 0xFEFF, 0xFEFF },
{ 0xFFF9, 0xFFFB }, { 0x01FD, 0x01FD }, { 0x02E0, 0x02E0 },
{ 0x0376, 0x037A }, { 0x0A01, 0x0A0F }, { 0x0A38, 0x0A3F },
{ 0x0AE5, 0x0AE6 }, { 0x0D24, 0x0D27 }, { 0x0EAB, 0x0EAC },
{ 0x0EFD, 0x0EFF }, { 0x0F46, 0x0F50 }, { 0x0F82, 0x0F85 },
{ 0x1001, 0x1001 }, { 0x1038, 0x1046 }, { 0x1070, 0x1070 },
{ 0x1073, 0x1074 }, { 0x107F, 0x1081 }, { 0x10B3, 0x10B6 },
{ 0x10B9, 0x10BA }, { 0x10BD, 0x10BD }, { 0x10C2, 0x10CD },
{ 0x1100, 0x1102 }, { 0x1127, 0x112B }, { 0x112D, 0x1134 },
{ 0x1173, 0x1173 }, { 0x1180, 0x1181 }, { 0x11B6, 0x11BE },
{ 0x11C9, 0x11CC }, { 0x11CF, 0x11CF }, { 0x122F, 0x1231 },
{ 0x1234, 0x1234 }, { 0x1236, 0x1237 }, { 0x123E, 0x123E },
{ 0x1241, 0x1241 }, { 0x12DF, 0x12DF }, { 0x12E3, 0x12EA },
{ 0x1300, 0x1301 }, { 0x133B, 0x133C }, { 0x1340, 0x1340 },
{ 0x1366, 0x1374 }, { 0x1438, 0x143F }, { 0x1442, 0x1444 },
{ 0x0AE5, 0x0AE6 }, { 0x0D24, 0x0D27 }, { 0x0D69, 0x0D6D },
{ 0x0EAB, 0x0EAC }, { 0x0EFC, 0x0EFF }, { 0x0F46, 0x0F50 },
{ 0x0F82, 0x0F85 }, { 0x1001, 0x1001 }, { 0x1038, 0x1046 },
{ 0x1070, 0x1070 }, { 0x1073, 0x1074 }, { 0x107F, 0x1081 },
{ 0x10B3, 0x10B6 }, { 0x10B9, 0x10BA }, { 0x10BD, 0x10BD },
{ 0x10C2, 0x10CD }, { 0x1100, 0x1102 }, { 0x1127, 0x112B },
{ 0x112D, 0x1134 }, { 0x1173, 0x1173 }, { 0x1180, 0x1181 },
{ 0x11B6, 0x11BE }, { 0x11C9, 0x11CC }, { 0x11CF, 0x11CF },
{ 0x122F, 0x1231 }, { 0x1234, 0x1234 }, { 0x1236, 0x1237 },
{ 0x123E, 0x123E }, { 0x1241, 0x1241 }, { 0x12DF, 0x12DF },
{ 0x12E3, 0x12EA }, { 0x1300, 0x1301 }, { 0x133B, 0x133C },
{ 0x1340, 0x1340 }, { 0x1366, 0x1374 }, { 0x13BB, 0x13C0 },
{ 0x13CE, 0x13CE }, { 0x13D0, 0x13D0 }, { 0x13D2, 0x13D2 },
{ 0x13E1, 0x13E2 }, { 0x1438, 0x143F }, { 0x1442, 0x1444 },
{ 0x1446, 0x1446 }, { 0x145E, 0x145E }, { 0x14B3, 0x14B8 },
{ 0x14BA, 0x14BA }, { 0x14BF, 0x14C0 }, { 0x14C2, 0x14C3 },
{ 0x15B2, 0x15B5 }, { 0x15BC, 0x15BD }, { 0x15BF, 0x15C0 },
{ 0x15DC, 0x162F }, { 0x1633, 0x163A }, { 0x163D, 0x163D },
{ 0x163F, 0x1640 }, { 0x16AB, 0x16AB }, { 0x16AD, 0x16AD },
{ 0x16B0, 0x16B5 }, { 0x16B7, 0x16B7 }, { 0x171D, 0x171F },
{ 0x1722, 0x1725 }, { 0x1727, 0x172B }, { 0x182F, 0x1837 },
{ 0x1839, 0x183A }, { 0x193B, 0x193C }, { 0x193E, 0x193E },
{ 0x1943, 0x1943 }, { 0x19D4, 0x19DB }, { 0x19E0, 0x19E0 },
{ 0x1A01, 0x1A0A }, { 0x1A33, 0x1A38 }, { 0x1A3B, 0x1A3E },
{ 0x1A47, 0x1A47 }, { 0x1A51, 0x1A56 }, { 0x1A59, 0x1A5B },
{ 0x1A8A, 0x1A96 }, { 0x1A98, 0x1A99 }, { 0x1C30, 0x1C3D },
{ 0x1C3F, 0x1C3F }, { 0x1C92, 0x1CA7 }, { 0x1CAA, 0x1CB0 },
{ 0x1CB2, 0x1CB3 }, { 0x1CB5, 0x1CB6 }, { 0x1D31, 0x1D45 },
{ 0x1D47, 0x1D47 }, { 0x1D90, 0x1D91 }, { 0x1D95, 0x1D95 },
{ 0x1D97, 0x1D97 }, { 0x1EF3, 0x1EF4 }, { 0x1F00, 0x1F01 },
{ 0x1F36, 0x1F3A }, { 0x1F40, 0x1F40 }, { 0x1F42, 0x1F42 },
{ 0x3430, 0x3440 }, { 0x3447, 0x3455 }, { 0x6AF0, 0x6AF4 },
{ 0x6B30, 0x6B36 }, { 0x6F4F, 0x6F4F }, { 0x6F8F, 0x6F92 },
{ 0x6FE4, 0x6FE4 }, { 0xBC9D, 0xBC9E }, { 0xBCA0, 0xCF46 },
{ 0xD167, 0xD169 }, { 0xD173, 0xD182 }, { 0xD185, 0xD18B },
{ 0xD1AA, 0xD1AD }, { 0xD242, 0xD244 }, { 0xDA00, 0xDA36 },
{ 0xDA3B, 0xDA6C }, { 0xDA75, 0xDA75 }, { 0xDA84, 0xDA84 },
{ 0xDA9B, 0xDAAF }, { 0xE000, 0xE02A }, { 0xE08F, 0xE08F },
{ 0xE130, 0xE136 }, { 0xE2AE, 0xE2AE }, { 0xE2EC, 0xE2EF },
{ 0xE4EC, 0xE4EF }, { 0xE8D0, 0xE8D6 }, { 0xE944, 0xE94A },
{ 0x16B0, 0x16B5 }, { 0x16B7, 0x16B7 }, { 0x171D, 0x171D },
{ 0x171F, 0x171F }, { 0x1722, 0x1725 }, { 0x1727, 0x172B },
{ 0x182F, 0x1837 }, { 0x1839, 0x183A }, { 0x193B, 0x193C },
{ 0x193E, 0x193E }, { 0x1943, 0x1943 }, { 0x19D4, 0x19DB },
{ 0x19E0, 0x19E0 }, { 0x1A01, 0x1A0A }, { 0x1A33, 0x1A38 },
{ 0x1A3B, 0x1A3E }, { 0x1A47, 0x1A47 }, { 0x1A51, 0x1A56 },
{ 0x1A59, 0x1A5B }, { 0x1A8A, 0x1A96 }, { 0x1A98, 0x1A99 },
{ 0x1C30, 0x1C3D }, { 0x1C3F, 0x1C3F }, { 0x1C92, 0x1CA7 },
{ 0x1CAA, 0x1CB0 }, { 0x1CB2, 0x1CB3 }, { 0x1CB5, 0x1CB6 },
{ 0x1D31, 0x1D45 }, { 0x1D47, 0x1D47 }, { 0x1D90, 0x1D91 },
{ 0x1D95, 0x1D95 }, { 0x1D97, 0x1D97 }, { 0x1EF3, 0x1EF4 },
{ 0x1F00, 0x1F01 }, { 0x1F36, 0x1F3A }, { 0x1F40, 0x1F40 },
{ 0x1F42, 0x1F42 }, { 0x1F5A, 0x1F5A }, { 0x3430, 0x3440 },
{ 0x3447, 0x3455 }, { 0x611E, 0x6129 }, { 0x612D, 0x612F },
{ 0x6AF0, 0x6AF4 }, { 0x6B30, 0x6B36 }, { 0x6F4F, 0x6F4F },
{ 0x6F8F, 0x6F92 }, { 0x6FE4, 0x6FE4 }, { 0xBC9D, 0xBC9E },
{ 0xBCA0, 0xBCA3 }, { 0xCF00, 0xCF46 }, { 0xD167, 0xD169 },
{ 0xD173, 0xD182 }, { 0xD185, 0xD18B }, { 0xD1AA, 0xD1AD },
{ 0xD242, 0xD244 }, { 0xDA00, 0xDA36 }, { 0xDA3B, 0xDA6C },
{ 0xDA75, 0xDA75 }, { 0xDA84, 0xDA84 }, { 0xDA9B, 0xDAAF },
{ 0xE000, 0xE02A }, { 0xE08F, 0xE08F }, { 0xE130, 0xE136 },
{ 0xE2AE, 0xE2AE }, { 0xE2EC, 0xE2EF }, { 0xE4EC, 0xE4EF },
{ 0xE5EE, 0xE5EF }, { 0xE8D0, 0xE8D6 }, { 0xE944, 0xE94A },
{ 0x0001, 0x01EF } };

const uint16_t tbl_for_fullwidth_chars[][2] = {
{ /* plane 0 */ 0, 46 },
{ /* plane 1 */ 46, 80 },
{ /* plane 2 */ 80, 81 },
{ /* plane 3 */ 81, 82 },
{ /* plane 0 */ 0, 47 },
{ /* plane 1 */ 47, 82 },
{ /* plane 2 */ 82, 83 },
{ /* plane 3 */ 83, 84 },
{ /* plane 4 */ 0, 0 },
{ /* plane 5 */ 0, 0 },
{ /* plane 6 */ 0, 0 },
Expand All @@ -355,32 +359,32 @@ const uint16_t tbl_for_fullwidth_chars[][2] = {
{ /* plane 16 */ 0, 0 },
{ 0x1100, 0x115F }, { 0x231A, 0x231B }, { 0x2329, 0x232A },
{ 0x23E9, 0x23EC }, { 0x23F0, 0x23F0 }, { 0x23F3, 0x23F3 },
{ 0x25FD, 0x25FE }, { 0x2614, 0x2615 }, { 0x2648, 0x2653 },
{ 0x267F, 0x267F }, { 0x2693, 0x2693 }, { 0x26A1, 0x26A1 },
{ 0x26AA, 0x26AB }, { 0x26BD, 0x26BE }, { 0x26C4, 0x26C5 },
{ 0x26CE, 0x26CE }, { 0x26D4, 0x26D4 }, { 0x26EA, 0x26EA },
{ 0x26F2, 0x26F3 }, { 0x26F5, 0x26F5 }, { 0x26FA, 0x26FA },
{ 0x26FD, 0x26FD }, { 0x2705, 0x2705 }, { 0x270A, 0x270B },
{ 0x2728, 0x2728 }, { 0x274C, 0x274C }, { 0x274E, 0x274E },
{ 0x2753, 0x2755 }, { 0x2757, 0x2757 }, { 0x2795, 0x2797 },
{ 0x27B0, 0x27B0 }, { 0x27BF, 0x27BF }, { 0x2B1B, 0x2B1C },
{ 0x2B50, 0x2B50 }, { 0x2B55, 0x2B55 }, { 0x2E80, 0x303E },
{ 0x3041, 0x3247 }, { 0x3250, 0x4DBF }, { 0x4E00, 0xA4C6 },
{ 0xA960, 0xA97C }, { 0xAC00, 0xD7A3 }, { 0xF900, 0xFAFF },
{ 0xFE10, 0xFE19 }, { 0xFE30, 0xFE6B }, { 0xFF01, 0xFF60 },
{ 0xFFE0, 0xFFE6 }, { 0x6FE0, 0xB2FB }, { 0xF004, 0xF004 },
{ 0xF0CF, 0xF0CF }, { 0xF18E, 0xF18E }, { 0xF191, 0xF19A },
{ 0xF200, 0xF320 }, { 0xF32D, 0xF335 }, { 0xF337, 0xF37C },
{ 0xF37E, 0xF393 }, { 0xF3A0, 0xF3CA }, { 0xF3CF, 0xF3D3 },
{ 0xF3E0, 0xF3F0 }, { 0xF3F4, 0xF3F4 }, { 0xF3F8, 0xF43E },
{ 0xF440, 0xF440 }, { 0xF442, 0xF4FC }, { 0xF4FF, 0xF53D },
{ 0xF54B, 0xF54E }, { 0xF550, 0xF567 }, { 0xF57A, 0xF57A },
{ 0xF595, 0xF596 }, { 0xF5A4, 0xF5A4 }, { 0xF5FB, 0xF64F },
{ 0xF680, 0xF6C5 }, { 0xF6CC, 0xF6CC }, { 0xF6D0, 0xF6D2 },
{ 0xF6D5, 0xF6DF }, { 0xF6EB, 0xF6EC }, { 0xF6F4, 0xF6FC },
{ 0xF7E0, 0xF7F0 }, { 0xF90C, 0xF93A }, { 0xF93C, 0xF945 },
{ 0xF947, 0xF9FF }, { 0xFA70, 0xFAF6 }, { 0x0000, 0xFFFF },
{ 0x0000, 0xFFFD } };
{ 0x25FD, 0x25FE }, { 0x2614, 0x2615 }, { 0x2630, 0x2637 },
{ 0x2648, 0x2653 }, { 0x267F, 0x267F }, { 0x268A, 0x268F },
{ 0x2693, 0x2693 }, { 0x26A1, 0x26A1 }, { 0x26AA, 0x26AB },
{ 0x26BD, 0x26BE }, { 0x26C4, 0x26C5 }, { 0x26CE, 0x26CE },
{ 0x26D4, 0x26D4 }, { 0x26EA, 0x26EA }, { 0x26F2, 0x26F3 },
{ 0x26F5, 0x26F5 }, { 0x26FA, 0x26FA }, { 0x26FD, 0x26FD },
{ 0x2705, 0x2705 }, { 0x270A, 0x270B }, { 0x2728, 0x2728 },
{ 0x274C, 0x274C }, { 0x274E, 0x274E }, { 0x2753, 0x2755 },
{ 0x2757, 0x2757 }, { 0x2795, 0x2797 }, { 0x27B0, 0x27B0 },
{ 0x27BF, 0x27BF }, { 0x2B1B, 0x2B1C }, { 0x2B50, 0x2B50 },
{ 0x2B55, 0x2B55 }, { 0x2E80, 0x303E }, { 0x3041, 0x3247 },
{ 0x3250, 0xA4C6 }, { 0xA960, 0xA97C }, { 0xAC00, 0xD7A3 },
{ 0xF900, 0xFAFF }, { 0xFE10, 0xFE19 }, { 0xFE30, 0xFE6B },
{ 0xFF01, 0xFF60 }, { 0xFFE0, 0xFFE6 }, { 0x6FE0, 0xB2FB },
{ 0xD300, 0xD376 }, { 0xF004, 0xF004 }, { 0xF0CF, 0xF0CF },
{ 0xF18E, 0xF18E }, { 0xF191, 0xF19A }, { 0xF200, 0xF320 },
{ 0xF32D, 0xF335 }, { 0xF337, 0xF37C }, { 0xF37E, 0xF393 },
{ 0xF3A0, 0xF3CA }, { 0xF3CF, 0xF3D3 }, { 0xF3E0, 0xF3F0 },
{ 0xF3F4, 0xF3F4 }, { 0xF3F8, 0xF43E }, { 0xF440, 0xF440 },
{ 0xF442, 0xF4FC }, { 0xF4FF, 0xF53D }, { 0xF54B, 0xF54E },
{ 0xF550, 0xF567 }, { 0xF57A, 0xF57A }, { 0xF595, 0xF596 },
{ 0xF5A4, 0xF5A4 }, { 0xF5FB, 0xF64F }, { 0xF680, 0xF6C5 },
{ 0xF6CC, 0xF6CC }, { 0xF6D0, 0xF6D2 }, { 0xF6D5, 0xF6DF },
{ 0xF6EB, 0xF6EC }, { 0xF6F4, 0xF6FC }, { 0xF7E0, 0xF7F0 },
{ 0xF90C, 0xF93A }, { 0xF93C, 0xF945 }, { 0xF947, 0xF9FF },
{ 0xFA70, 0xFAF8 }, { 0x0000, 0xFFFF }, { 0x0000, 0xFFFD } };

/* test for 8-bit control characters */
if (ucs == 0)
Expand Down

0 comments on commit a5f13c2

Please sign in to comment.