summaryrefslogtreecommitdiff
path: root/ext/standard/html_tables/html_table_gen.php
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/html_tables/html_table_gen.php')
-rwxr-xr-xext/standard/html_tables/html_table_gen.php30
1 files changed, 15 insertions, 15 deletions
diff --git a/ext/standard/html_tables/html_table_gen.php b/ext/standard/html_tables/html_table_gen.php
index a1c4763e00..890c7e9d1e 100755
--- a/ext/standard/html_tables/html_table_gen.php
+++ b/ext/standard/html_tables/html_table_gen.php
@@ -189,10 +189,10 @@ foreach ($encodings as $e) {
if (preg_match("/^0x([0-9A-Z]{2})\t0x([0-9A-Z]{2,})/i", $l, $matches))
$map[] = array($matches[1], $matches[2]);
}
-
+
$mappy = array();
foreach ($map as $v) { $mappy[hexdec($v[0])] = hexdec($v[1]); }
-
+
$mstable = array("ident" => $e['ident']);
/* calculate two-stage tables */
for ($i = 0; $i < 4; $i++) {
@@ -201,7 +201,7 @@ foreach ($encodings as $e) {
$mstable[$i][$j] = isset($mappy[$cp]) ? $mappy[$cp] : NULL;
}
}
-
+
echo
"/* {{{ Stage 2 tables for {$e['name']} */\n\n";
@@ -211,9 +211,9 @@ foreach ($encodings as $e) {
$s2tables_idents[$i] = $encodings[$t[0]/5]["ident"];
continue;
}
-
+
$s2tables_idents[$i] = $e["ident"];
-
+
echo "static const enc_to_uni_stage2 enc_to_uni_s2_{$e['ident']}_".
sprintf("%02X", $i << 6)." = { {\n";
for ($j = 0; $j < 64; $j++) {
@@ -226,10 +226,10 @@ foreach ($encodings as $e) {
echo "0xFFFF,"; /* special value; indicates no mapping */
}
echo "\n} };\n\n";
-
+
$prevStage2[] = $mstable[$i];
}
-
+
echo
"/* end of stage 2 tables for {$e['name']} }}} */\n\n";
@@ -332,23 +332,23 @@ foreach ($encodings as $e) {
if (preg_match("/^0x([0-9A-Z]{2})\t0x([0-9A-Z]{2,})\s+#\s*(.*)$/i", $l, $matches))
$map[] = array($matches[1], $matches[2], rtrim($matches[3]));
}
-
+
$mappy = array();
foreach ($map as $v) {
if (hexdec($v[0]) >= $e['range'][0] && hexdec($v[0]) <= $e['range'][1])
$mappy[hexdec($v[1])] = array(hexdec($v[0]), strtolower($v[2]));
}
ksort($mappy);
-
+
echo
"static const uni_to_enc unimap_{$e['ident']}[] = {\n";
-
+
foreach ($mappy as $k => $v) {
echo "\t{ ", sprintf("0x%04X", $k), ", ", sprintf("0x%02X", $v[0]), " },\t/* ",
$v[1], " */\n";
}
echo "};\n";
-
+
echo
"/* {{{ end of mappings *from* Unicode for {$e['name']} */\n\n";
}
@@ -475,7 +475,7 @@ foreach ($multicp_rows as $k => $v) {
$v['default'] = "gt";
echo "\t{ {", sprintf("\"%-21s", $v["default"].'",'),
"\t", sprintf("%02d", (count($v) - 1)), ",\t\t",
- sprintf("% 2d", strlen($v["default"])), '} },', "\n";
+ sprintf("% 2d", strlen($v["default"])), '} },', "\n";
} else {
echo "\t{ {", sprintf("%-22s", 'NULL,'),
"\t", sprintf("%02d", count($v)), ",\t\t0} },\n";
@@ -483,7 +483,7 @@ foreach ($multicp_rows as $k => $v) {
unset($v["default"]);
foreach ($v as $l => $w) {
echo "\t{ {", sprintf("\"%-21s", $w.'",'), "\t", sprintf("0x%05s", $l), ",\t",
- sprintf("% 2d", strlen($w)), '} },', "\n";
+ sprintf("% 2d", strlen($w)), '} },', "\n";
}
echo "};\n";
}
@@ -560,7 +560,7 @@ for ($i = 0; $i < 0x1E; $i++) {
else
echo "{1, { {(void *)", sprintf("multi_cp_{$ident}_%05X",
($i << 12) | ($k << 6) | $y ), ", 0} } },";
-
+
}
echo "\n};\n\n";
}
@@ -684,7 +684,7 @@ echo
// die("violated assumption for traverse_for_entities");
// }
// }
-//
+//
// $k++;
//}
//echo "\n};\n\n";