Commit e17dab53 authored by Tom Lane's avatar Tom Lane

Auto-generate file header comments in Unicode mapping files.

Some of the Unicode/*.map files had identification comments added to them,
evidently by hand.  Others did not.  Modify the generating scripts to
produce these comments automatically, and update the generated files that
lacked them.

This is just minor cleanup as a by-product of trying to verify that the
*.map files can indeed be reproduced from authoritative data.  There are a
depressingly large number that fail to reproduce from the claimed sources.
I have not touched those in this commit, except for the JIS 2004-related
files which required only a single comment update to match.

Since this only affects comments, no need to consider a back-patch.
parent 40cb21f7
......@@ -97,6 +97,8 @@ close(FILE);
$file = lc("utf8_to_big5.map");
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_utf_to_local ULmapBIG5[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
......@@ -185,6 +187,8 @@ close(FILE);
$file = lc("big5_to_utf8.map");
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_local_to_utf LUmapBIG5[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
{
......
......@@ -55,6 +55,8 @@ close(FILE);
$file = "utf8_to_euc_cn.map";
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_utf_to_local ULmapEUC_CN[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
......@@ -109,6 +111,8 @@ close(FILE);
$file = "euc_cn_to_utf8.map";
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_local_to_utf LUmapEUC_CN[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
{
......
......@@ -136,6 +136,8 @@ close(FILE);
$file = "utf8_to_euc_jp.map";
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_utf_to_local ULmapEUC_JP[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
......@@ -263,6 +265,8 @@ close(FILE);
$file = "euc_jp_to_utf8.map";
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_local_to_utf LUmapEUC_JP[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
{
......
......@@ -55,6 +55,8 @@ close(FILE);
$file = "utf8_to_euc_kr.map";
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_utf_to_local ULmapEUC_KR[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
......@@ -109,6 +111,8 @@ close(FILE);
$file = "euc_kr_to_utf8.map";
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_local_to_utf LUmapEUC_KR[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
{
......
......@@ -71,6 +71,8 @@ close(FILE);
$file = "utf8_to_euc_tw.map";
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_utf_to_local ULmapEUC_TW[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
......@@ -138,6 +140,8 @@ close(FILE);
$file = "euc_tw_to_utf8.map";
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_local_to_utf LUmapEUC_TW[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
{
......
......@@ -56,6 +56,8 @@ close(FILE);
$file = "utf8_to_gb18030.map";
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_utf_to_local ULmapGB18030[ $count ] = {\n";
$cc = $count;
......@@ -83,6 +85,8 @@ close(FILE);
$file = "gb18030_to_utf8.map";
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_local_to_utf LUmapGB18030[ $count ] = {\n";
$cc = $count;
......
......@@ -72,6 +72,8 @@ close(FILE);
$file = "utf8_to_sjis.map";
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_utf_to_local ULmapSJIS[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
......@@ -122,6 +124,8 @@ close(FILE);
$file = "sjis_to_utf8.map";
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_local_to_utf LUmapSJIS[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
{
......
......@@ -88,6 +88,8 @@ foreach $charset (@charsets)
$file = lc("utf8_to_${charset}.map");
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_utf_to_local ULmap${charset}[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
......@@ -140,6 +142,8 @@ foreach $charset (@charsets)
$file = lc("${charset}_to_utf8.map");
open(FILE, "> $file") || die("cannot open $file");
print FILE "/* src/backend/utils/mb/Unicode/$file */\n\n";
print FILE "static const pg_local_to_utf LUmap${charset}[ $count ] = {\n";
for $index (sort { $a <=> $b } keys(%array))
{
......
/* src/backend/utils/mb/Unicode/big5_to_utf8.map */
static const pg_local_to_utf LUmapBIG5[ 13717 ] = {
{0xa140, 0xe38080},
{0xa141, 0xefbc8c},
......
......@@ -333,7 +333,7 @@ static const pg_local_to_utf LUmapEUC_JIS_2004[] = {
{0x00a2ac, 0x00e28691}, /* U+2191 UPWARDS ARROW */
{0x00a2ad, 0x00e28693}, /* U+2193 DOWNWARDS ARROW */
{0x00a2ae, 0x00e38093}, /* U+3013 GETA MARK */
{0x00a2af, 0x00efbc87}, /* U+FF07 FULLWIDTH APOSTROPHE */
{0x00a2af, 0x00efbc87}, /* U+FF07 FULLWIDTH APOSTROPHE [2000] */
{0x00a2b0, 0x00efbc82}, /* U+FF02 FULLWIDTH QUOTATION MARK [2000] */
{0x00a2b1, 0x00efbc8d}, /* U+FF0D FULLWIDTH HYPHEN-MINUS [2000] */
{0x00a2b2, 0x00efbd9e}, /* U+FF5E FULLWIDTH TILDE [2000] */
......
/* src/backend/utils/mb/Unicode/koi8u_to_utf8.map */
static const pg_local_to_utf LUmapKOI8U[ 128 ] = {
{0x0080, 0xe29480},
{0x0081, 0xe29482},
......
......@@ -301,7 +301,7 @@ static const pg_local_to_utf LUmapSHIFT_JIS_2004[] = {
{0x81aa, 0x00e28691}, /* U+2191 UPWARDS ARROW */
{0x81ab, 0x00e28693}, /* U+2193 DOWNWARDS ARROW */
{0x81ac, 0x00e38093}, /* U+3013 GETA MARK */
{0x81ad, 0x00efbc87}, /* U+FF07 FULLWIDTH APOSTROPHE */
{0x81ad, 0x00efbc87}, /* U+FF07 FULLWIDTH APOSTROPHE [2000] */
{0x81ae, 0x00efbc82}, /* U+FF02 FULLWIDTH QUOTATION MARK [2000] */
{0x81af, 0x00efbc8d}, /* U+FF0D FULLWIDTH HYPHEN-MINUS [2000] */
{0x81b0, 0x0000007e}, /* U+007E TILDE [2000] Fullwidth: U+FF5E */
......
/* src/backend/utils/mb/Unicode/sjis_to_utf8.map */
static const pg_local_to_utf LUmapSJIS[ 7787 ] = {
{0x00a1, 0xefbda1},
{0x00a2, 0xefbda2},
......
/* src/backend/utils/mb/Unicode/utf8_to_big5.map */
static const pg_utf_to_local ULmapBIG5[ 13711 ] = {
{0xc2a2, 0xa246},
{0xc2a3, 0xa247},
......
......@@ -10977,7 +10977,7 @@ static const pg_utf_to_local ULmapEUC_JIS_2004[] = {
{0x00efbc84, 0x00a1f0}, /* U+FF04 FULLWIDTH DOLLAR SIGN */
{0x00efbc85, 0x00a1f3}, /* U+FF05 FULLWIDTH PERCENT SIGN */
{0x00efbc86, 0x00a1f5}, /* U+FF06 FULLWIDTH AMPERSAND */
{0x00efbc87, 0x00a2af}, /* U+FF07 FULLWIDTH APOSTROPHE */
{0x00efbc87, 0x00a2af}, /* U+FF07 FULLWIDTH APOSTROPHE [2000] */
{0x00efbc88, 0x00a1ca}, /* U+FF08 FULLWIDTH LEFT PARENTHESIS */
{0x00efbc89, 0x00a1cb}, /* U+FF09 FULLWIDTH RIGHT PARENTHESIS */
{0x00efbc8a, 0x00a1f6}, /* U+FF0A FULLWIDTH ASTERISK */
......
/* src/backend/utils/mb/Unicode/utf8_to_euc_tw.map */
static const pg_utf_to_local ULmapEUC_TW[ 17711 ] = {
{0xc2a7, 0xa1f0},
{0xc2b0, 0xa2f8},
......
/* src/backend/utils/mb/Unicode/utf8_to_gbk.map */
static const pg_utf_to_local ULmapGBK[ 21792 ] = {
{0xc2a4, 0xa1e8},
{0xc2a7, 0xa1ec},
......
/* src/backend/utils/mb/Unicode/utf8_to_iso8859_10.map */
static const pg_utf_to_local ULmapISO8859_10[ 128 ] = {
{0xc280, 0x0080},
{0xc281, 0x0081},
......
/* src/backend/utils/mb/Unicode/utf8_to_iso8859_13.map */
static const pg_utf_to_local ULmapISO8859_13[ 128 ] = {
{0xc280, 0x0080},
{0xc281, 0x0081},
......
/* src/backend/utils/mb/Unicode/utf8_to_iso8859_14.map */
static const pg_utf_to_local ULmapISO8859_14[ 128 ] = {
{0xc280, 0x0080},
{0xc281, 0x0081},
......
/* src/backend/utils/mb/Unicode/utf8_to_iso8859_15.map */
static const pg_utf_to_local ULmapISO8859_15[ 128 ] = {
{0xc280, 0x0080},
{0xc281, 0x0081},
......
/* src/backend/utils/mb/Unicode/utf8_to_iso8859_16.map */
static const pg_utf_to_local ULmapISO8859_16[ 128 ] = {
{0xc280, 0x0080},
{0xc281, 0x0081},
......
/* src/backend/utils/mb/Unicode/utf8_to_iso8859_2.map */
static const pg_utf_to_local ULmapISO8859_2[ 128 ] = {
{0xc280, 0x0080},
{0xc281, 0x0081},
......
/* src/backend/utils/mb/Unicode/utf8_to_iso8859_3.map */
static const pg_utf_to_local ULmapISO8859_3[ 121 ] = {
{0xc280, 0x0080},
{0xc281, 0x0081},
......
/* src/backend/utils/mb/Unicode/utf8_to_iso8859_4.map */
static const pg_utf_to_local ULmapISO8859_4[ 128 ] = {
{0xc280, 0x0080},
{0xc281, 0x0081},
......
/* src/backend/utils/mb/Unicode/utf8_to_iso8859_5.map */
static const pg_utf_to_local ULmapISO8859_5[ 128 ] = {
{0xc280, 0x0080},
{0xc281, 0x0081},
......
/* src/backend/utils/mb/Unicode/utf8_to_iso8859_6.map */
static const pg_utf_to_local ULmapISO8859_6[ 83 ] = {
{0xc280, 0x0080},
{0xc281, 0x0081},
......
/* src/backend/utils/mb/Unicode/utf8_to_iso8859_7.map */
static const pg_utf_to_local ULmapISO8859_7[ 125 ] = {
{0xc280, 0x0080},
{0xc281, 0x0081},
......
/* src/backend/utils/mb/Unicode/utf8_to_iso8859_8.map */
static const pg_utf_to_local ULmapISO8859_8[ 92 ] = {
{0xc280, 0x0080},
{0xc281, 0x0081},
......
/* src/backend/utils/mb/Unicode/utf8_to_iso8859_9.map */
static const pg_utf_to_local ULmapISO8859_9[ 128 ] = {
{0xc280, 0x0080},
{0xc281, 0x0081},
......
/* src/backend/utils/mb/Unicode/utf8_to_koi8r.map */
static const pg_utf_to_local ULmapKOI8R[ 128 ] = {
{0xc2a0, 0x009a},
{0xc2a9, 0x00bf},
......
/* src/backend/utils/mb/Unicode/utf8_to_koi8u.map */
static const pg_utf_to_local ULmapKOI8U[ 128 ] = {
{0xc2a0, 0x009a},
{0xc2a9, 0x00bf},
......
......@@ -10945,7 +10945,7 @@ static const pg_utf_to_local ULmapSHIFT_JIS_2004[] = {
{0x00efbc84, 0x008190}, /* U+FF04 FULLWIDTH DOLLAR SIGN */
{0x00efbc85, 0x008193}, /* U+FF05 FULLWIDTH PERCENT SIGN */
{0x00efbc86, 0x008195}, /* U+FF06 FULLWIDTH AMPERSAND */
{0x00efbc87, 0x0081ad}, /* U+FF07 FULLWIDTH APOSTROPHE */
{0x00efbc87, 0x0081ad}, /* U+FF07 FULLWIDTH APOSTROPHE [2000] */
{0x00efbc88, 0x008169}, /* U+FF08 FULLWIDTH LEFT PARENTHESIS */
{0x00efbc89, 0x00816a}, /* U+FF09 FULLWIDTH RIGHT PARENTHESIS */
{0x00efbc8a, 0x008196}, /* U+FF0A FULLWIDTH ASTERISK */
......
/* src/backend/utils/mb/Unicode/utf8_to_win1250.map */
static const pg_utf_to_local ULmapWIN1250[ 123 ] = {
{0xc2a0, 0x00a0},
{0xc2a4, 0x00a4},
......
/* src/backend/utils/mb/Unicode/utf8_to_win1251.map */
static const pg_utf_to_local ULmapWIN1251[ 127 ] = {
{0xc2a0, 0x00a0},
{0xc2a4, 0x00a4},
......
/* src/backend/utils/mb/Unicode/utf8_to_win1252.map */
static const pg_utf_to_local ULmapWIN1252[ 123 ] = {
{0xc2a0, 0x00a0},
{0xc2a1, 0x00a1},
......
/* src/backend/utils/mb/Unicode/utf8_to_win1253.map */
static const pg_utf_to_local ULmapWIN1253[ 111 ] = {
{0xc2a0, 0x00a0},
{0xc2a3, 0x00a3},
......
/* src/backend/utils/mb/Unicode/utf8_to_win1254.map */
static const pg_utf_to_local ULmapWIN1254[ 121 ] = {
{0xc2a0, 0x00a0},
{0xc2a1, 0x00a1},
......
/* src/backend/utils/mb/Unicode/utf8_to_win1255.map */
static const pg_utf_to_local ULmapWIN1255[ 105 ] = {
{0xc2a0, 0x00a0},
{0xc2a1, 0x00a1},
......
/* src/backend/utils/mb/Unicode/utf8_to_win1256.map */
static const pg_utf_to_local ULmapWIN1256[ 128 ] = {
{0xc2a0, 0x00a0},
{0xc2a2, 0x00a2},
......
/* src/backend/utils/mb/Unicode/utf8_to_win1257.map */
static const pg_utf_to_local ULmapWIN1257[ 116 ] = {
{0xc2a0, 0x00a0},
{0xc2a2, 0x00a2},
......
/* src/backend/utils/mb/Unicode/utf8_to_win1258.map */
static const pg_utf_to_local ULmapWIN1258[ 119 ] = {
{0xc2a0, 0x00a0},
{0xc2a1, 0x00a1},
......
/* src/backend/utils/mb/Unicode/utf8_to_win866.map */
static const pg_utf_to_local ULmapWIN866[ 128 ] = {
{0xc2a0, 0x00ff},
{0xc2a4, 0x00fd},
......
/* src/backend/utils/mb/Unicode/utf8_to_win874.map */
static const pg_utf_to_local ULmapWIN874[ 97 ] = {
{0xc2a0, 0x00a0},
{0xe0b881, 0x00a1},
......
/* src/backend/utils/mb/Unicode/win1250_to_utf8.map */
static const pg_local_to_utf LUmapWIN1250[ 123 ] = {
{0x0080, 0xe282ac},
{0x0082, 0xe2809a},
......
/* src/backend/utils/mb/Unicode/win1251_to_utf8.map */
static const pg_local_to_utf LUmapWIN1251[ 127 ] = {
{0x0080, 0xd082},
{0x0081, 0xd083},
......
/* src/backend/utils/mb/Unicode/win1252_to_utf8.map */
static const pg_local_to_utf LUmapWIN1252[ 123 ] = {
{0x0080, 0xe282ac},
{0x0082, 0xe2809a},
......
/* src/backend/utils/mb/Unicode/win1253_to_utf8.map */
static const pg_local_to_utf LUmapWIN1253[ 111 ] = {
{0x0080, 0xe282ac},
{0x0082, 0xe2809a},
......
/* src/backend/utils/mb/Unicode/win1254_to_utf8.map */
static const pg_local_to_utf LUmapWIN1254[ 121 ] = {
{0x0080, 0xe282ac},
{0x0082, 0xe2809a},
......
/* src/backend/utils/mb/Unicode/win1255_to_utf8.map */
static const pg_local_to_utf LUmapWIN1255[ 105 ] = {
{0x0080, 0xe282ac},
{0x0082, 0xe2809a},
......
/* src/backend/utils/mb/Unicode/win1256_to_utf8.map */
static const pg_local_to_utf LUmapWIN1256[ 128 ] = {
{0x0080, 0xe282ac},
{0x0081, 0xd9be},
......
/* src/backend/utils/mb/Unicode/win1257_to_utf8.map */
static const pg_local_to_utf LUmapWIN1257[ 116 ] = {
{0x0080, 0xe282ac},
{0x0082, 0xe2809a},
......
/* src/backend/utils/mb/Unicode/win1258_to_utf8.map */
static const pg_local_to_utf LUmapWIN1258[ 119 ] = {
{0x0080, 0xe282ac},
{0x0082, 0xe2809a},
......
/* src/backend/utils/mb/Unicode/win866_to_utf8.map */
static const pg_local_to_utf LUmapWIN866[ 128 ] = {
{0x0080, 0xd090},
{0x0081, 0xd091},
......
/* src/backend/utils/mb/Unicode/win874_to_utf8.map */
static const pg_local_to_utf LUmapWIN874[ 97 ] = {
{0x0080, 0xe282ac},
{0x0085, 0xe280a6},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment