about summary refs log tree commit diff
path: root/src/locale/legacychars.h
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2017-11-13 18:34:27 -0500
committerRich Felker <dalias@aerifal.cx>2017-11-13 18:34:27 -0500
commit105eff9dec51bc4898a74af2854ab71f927a5c3b (patch)
tree5ee1447893b7b760c599afb19341b5f8f2eb8ee3 /src/locale/legacychars.h
parenta71b46cfd289aa0ff829fc9a436c59c398f8326d (diff)
downloadmusl-105eff9dec51bc4898a74af2854ab71f927a5c3b.tar.gz
musl-105eff9dec51bc4898a74af2854ab71f927a5c3b.tar.xz
musl-105eff9dec51bc4898a74af2854ab71f927a5c3b.zip
generalize iconv framework for 8-bit codepages
previously, 8-bit codepages could only remap the high 128 bytes; the
low range was assumed/forced to agree with ascii. interpretation of
codepage table headers has been changed so that it's possible to
represent mappings for up to 256 slots (fewer if the initial portion
of the map is elided because it coincides with unicode codepoints).
this requires consuming a bit more of the 10-bit space of characters
that can be represented in 8-bit codepages, but there's still a plenty
left. the size of the legacy_chars table is actually reduced now by
eliding the first 256 entries and considering them to map implicitly
via the identity map.

before these changes, there seem to have been minor bugs/omissions in
codepage table generation, so it's likely that some actual bug fixes
are silently included in this commit. round-trip testing of a few
codepages was performed on the new version of the code, but no
differential testing against the old version was done.
Diffstat (limited to 'src/locale/legacychars.h')
-rw-r--r--src/locale/legacychars.h75
1 files changed, 37 insertions, 38 deletions
diff --git a/src/locale/legacychars.h b/src/locale/legacychars.h
index 914ad0d5..9639b4af 100644
--- a/src/locale/legacychars.h
+++ b/src/locale/legacychars.h
@@ -1,41 +1,40 @@
-0,1,160,167,168,169,175,176,178,183,184,198,215,216,230,247,248,162,163,165,
-196,197,198,199,201,214,215,216,220,224,226,228,229,230,231,232,233,234,235,
-236,238,239,242,244,246,248,249,251,252,255,256,257,258,259,260,261,262,263,
-264,265,266,267,268,269,270,271,272,273,274,275,278,279,280,281,282,283,284,
-285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,302,303,304,305,
-308,309,310,311,312,313,314,315,316,317,318,321,322,323,324,325,326,327,328,
-330,331,332,333,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,
-351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,
-370,371,372,373,374,375,376,377,378,379,380,381,382,402,416,417,431,432,536,
-537,538,539,710,711,728,729,731,732,733,768,769,771,777,803,890,900,901,902,
-904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,
-925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,
-945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,
-964,965,966,967,968,969,970,
-971,972,973,974,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,
-1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,
-1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,
-1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,
-1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,
-1098,1099,1100,1101,1102,1103,1105,1106,1107,1108,1109,1110,1111,1112,1113,
-1114,1115,1116,1118,1119,1168,1169,1456,1457,1458,1459,1460,1461,1462,1463,
-1464,1465,1467,1468,1469,1470,1471,1472,1473,1474,1475,1488,1489,1490,1491,
-1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,
-1507,1508,1509,1510,1511,1512,1513,1514,1520,1521,1522,1523,1524,1548,1563,
-1567,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,
-1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1600,1601,1602,
-1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,
-1618,1657,1662,1670,1672,1681,1688,1705,1711,1722,1726,1729,1746,3585,3586,
-3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,
-3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,
-3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,
-3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3647,3648,3649,3650,
-3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,
-3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,7682,7683,7690,7691,7710,
-7711,7744,7745,7766,7767,7776,7777,7786,7787,7808,7809,7810,7811,7812,7813,
-7922,7923,8204,8205,8206,8207,8211,8212,8213,8215,8216,8217,8218,8220,8221,
-8222,8224,8225,8226,8230,8240,8249,8250,8362,8363,8364,8367,8359,8470,8482,
-8729,8730,8776,8804,8805,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,
+256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,
+275,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,
+296,297,298,299,302,303,304,305,308,309,310,311,312,313,314,315,316,317,318,
+321,322,323,324,325,326,327,328,330,331,332,333,336,337,338,339,340,341,342,
+343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,
+362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,
+381,382,402,416,417,431,432,536,537,538,539,710,711,728,729,731,732,733,768,
+769,771,777,803,890,900,901,902,904,905,906,908,910,911,912,913,914,915,916,
+917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,
+937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,
+956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,
+1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1038,1039,1040,
+1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,
+1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,
+1071,
+1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,
+1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,
+1102,1103,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1118,
+1119,1168,1169,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1467,1468,
+1469,1470,1471,1472,1473,1474,1475,1488,1489,1490,1491,1492,1493,1494,1495,
+1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,
+1511,1512,1513,1514,1520,1521,1522,1523,1524,1548,1563,1567,1569,1570,1571,
+1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,
+1587,1588,1589,1590,1591,1592,1593,1594,1600,1601,1602,1603,1604,1605,1606,
+1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,1657,1662,1670,
+1672,1681,1688,1705,1711,1722,1726,1729,1746,3585,3586,3587,3588,3589,3590,
+3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,
+3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,
+3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,
+3636,3637,3638,3639,3640,3641,3642,3647,3648,3649,3650,3651,3652,3653,3654,
+3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,
+3670,3671,3672,3673,3674,3675,7682,7683,7690,7691,7710,7711,7744,7745,7766,
+7767,
+7776,7777,7786,7787,7808,7809,7810,7811,7812,7813,7922,7923,8204,8205,8206,
+8207,8211,8212,8213,8215,8216,8217,8218,8220,8221,8222,8224,8225,8226,8230,
+8240,8249,8250,8319,8359,8362,8363,8364,8367,8470,8482,8729,8730,8734,8745,
+8776,8801,8804,8805,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,
 9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,
 9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,
 9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,