mirror of
https://github.com/postgres/postgres.git
synced 2025-05-12 16:21:30 +03:00
Small fixes to the Perl scripts to create unicode conversion tables.
Add missing semicolons in UCS_to_* perl scripts. For consistency, use "$hashref->{key}" style everywhere. Kyotaro Horiguchi Discussion: https://www.postgresql.org/message-id/20170130.153738.139030994.horiguchi.kyotaro@lab.ntt.co.jp
This commit is contained in:
parent
8a815e3fc3
commit
bc1686f3f6
@ -69,7 +69,7 @@ while (<$in>)
|
|||||||
ucs => $ucs,
|
ucs => $ucs,
|
||||||
code => $code,
|
code => $code,
|
||||||
direction => 'both'
|
direction => 'both'
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
close($in);
|
close($in);
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ sub sjis2jis
|
|||||||
$pos = $pos - ((31 * 0x5e) + 12);
|
$pos = $pos - ((31 * 0x5e) + 12);
|
||||||
|
|
||||||
# after 85-ku 82-ten needs to be moved 2 codepoints
|
# after 85-ku 82-ten needs to be moved 2 codepoints
|
||||||
$pos = $pos - 2 if ($pos >= 84 * 0x5c + 82)
|
$pos = $pos - 2 if ($pos >= 84 * 0x5c + 82);
|
||||||
}
|
}
|
||||||
|
|
||||||
my $hi2 = $pos / 0x5e;
|
my $hi2 = $pos / 0x5e;
|
||||||
|
@ -55,7 +55,7 @@ foreach my $i (@$mapping)
|
|||||||
code => ($i->{code} + 0x8ea10000),
|
code => ($i->{code} + 0x8ea10000),
|
||||||
rest => $i->{rest},
|
rest => $i->{rest},
|
||||||
direction => 'to_unicode'
|
direction => 'to_unicode'
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ while (<$in>)
|
|||||||
ucs => $ucs,
|
ucs => $ucs,
|
||||||
code => $code,
|
code => $code,
|
||||||
direction => 'both'
|
direction => 'both'
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close($in);
|
close($in);
|
||||||
|
@ -40,7 +40,7 @@ while (<$in>)
|
|||||||
ucs => $ucs,
|
ucs => $ucs,
|
||||||
code => $code,
|
code => $code,
|
||||||
direction => 'both'
|
direction => 'both'
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close($in);
|
close($in);
|
||||||
|
@ -168,20 +168,20 @@ sub print_from_utf8_map
|
|||||||
"static const pg_utf_to_local ULmap${charset}[ %d ] = {",
|
"static const pg_utf_to_local ULmap${charset}[ %d ] = {",
|
||||||
scalar(@$table));
|
scalar(@$table));
|
||||||
my $first = 1;
|
my $first = 1;
|
||||||
foreach my $i (sort {$$a{utf8} <=> $$b{utf8}} @$table)
|
foreach my $i (sort {$a->{utf8} <=> $b->{utf8}} @$table)
|
||||||
{
|
{
|
||||||
print($out ",") if (!$first);
|
print($out ",") if (!$first);
|
||||||
$first = 0;
|
$first = 0;
|
||||||
print($out "\t/* $last_comment */") if ($verbose);
|
print($out "\t/* $last_comment */") if ($verbose);
|
||||||
|
|
||||||
printf($out "\n {0x%04x, 0x%04x}", $$i{utf8}, $$i{code});
|
printf($out "\n {0x%04x, 0x%04x}", $i->{utf8}, $i->{code});
|
||||||
if ($verbose >= 2)
|
if ($verbose >= 2)
|
||||||
{
|
{
|
||||||
$last_comment = "$$i{f}:$$i{l} $$i{comment}";
|
$last_comment = "$i->{f}:$i->{l} $i->{comment}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$last_comment = $$i{comment};
|
$last_comment = $i->{comment};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print($out "\t/* $last_comment */") if ($verbose);
|
print($out "\t/* $last_comment */") if ($verbose);
|
||||||
@ -202,14 +202,14 @@ sub print_from_utf8_combined_map
|
|||||||
"static const pg_utf_to_local_combined ULmap${charset}_combined[ %d ] = {",
|
"static const pg_utf_to_local_combined ULmap${charset}_combined[ %d ] = {",
|
||||||
scalar(@$table));
|
scalar(@$table));
|
||||||
my $first = 1;
|
my $first = 1;
|
||||||
foreach my $i (sort {$$a{utf8} <=> $$b{utf8}} @$table)
|
foreach my $i (sort {$a->{utf8} <=> $b->{utf8}} @$table)
|
||||||
{
|
{
|
||||||
print($out ",") if (!$first);
|
print($out ",") if (!$first);
|
||||||
$first = 0;
|
$first = 0;
|
||||||
print($out "\t/* $last_comment */") if ($verbose);
|
print($out "\t/* $last_comment */") if ($verbose);
|
||||||
|
|
||||||
printf($out "\n {0x%08x, 0x%08x, 0x%04x}", $$i{utf8}, $$i{utf8_second}, $$i{code});
|
printf($out "\n {0x%08x, 0x%08x, 0x%04x}", $i->{utf8}, $i->{utf8_second}, $i->{code});
|
||||||
$last_comment = "$$i{comment}";
|
$last_comment = "$i->{comment}";
|
||||||
}
|
}
|
||||||
print($out "\t/* $last_comment */") if ($verbose);
|
print($out "\t/* $last_comment */") if ($verbose);
|
||||||
print $out "\n};\n";
|
print $out "\n};\n";
|
||||||
@ -230,20 +230,20 @@ sub print_to_utf8_map
|
|||||||
"static const pg_local_to_utf LUmap${charset}[ %d ] = {",
|
"static const pg_local_to_utf LUmap${charset}[ %d ] = {",
|
||||||
scalar(@$table));
|
scalar(@$table));
|
||||||
my $first = 1;
|
my $first = 1;
|
||||||
foreach my $i (sort {$$a{code} <=> $$b{code}} @$table)
|
foreach my $i (sort {$a->{code} <=> $b->{code}} @$table)
|
||||||
{
|
{
|
||||||
print($out ",") if (!$first);
|
print($out ",") if (!$first);
|
||||||
$first = 0;
|
$first = 0;
|
||||||
print($out "\t/* $last_comment */") if ($verbose);
|
print($out "\t/* $last_comment */") if ($verbose);
|
||||||
|
|
||||||
printf($out "\n {0x%04x, 0x%x}", $$i{code}, $$i{utf8});
|
printf($out "\n {0x%04x, 0x%x}", $i->{code}, $i->{utf8});
|
||||||
if ($verbose >= 2)
|
if ($verbose >= 2)
|
||||||
{
|
{
|
||||||
$last_comment = "$$i{f}:$$i{l} $$i{comment}";
|
$last_comment = "$i->{f}:$i->{l} $i->{comment}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$last_comment = $$i{comment};
|
$last_comment = $i->{comment};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print($out "\t/* $last_comment */") if ($verbose);
|
print($out "\t/* $last_comment */") if ($verbose);
|
||||||
@ -265,14 +265,14 @@ sub print_to_utf8_combined_map
|
|||||||
"static const pg_local_to_utf_combined LUmap${charset}_combined[ %d ] = {",
|
"static const pg_local_to_utf_combined LUmap${charset}_combined[ %d ] = {",
|
||||||
scalar(@$table));
|
scalar(@$table));
|
||||||
my $first = 1;
|
my $first = 1;
|
||||||
foreach my $i (sort {$$a{code} <=> $$b{code}} @$table)
|
foreach my $i (sort {$a->{code} <=> $b->{code}} @$table)
|
||||||
{
|
{
|
||||||
print($out ",") if (!$first);
|
print($out ",") if (!$first);
|
||||||
$first = 0;
|
$first = 0;
|
||||||
print($out "\t/* $last_comment */") if ($verbose);
|
print($out "\t/* $last_comment */") if ($verbose);
|
||||||
|
|
||||||
printf($out "\n {0x%04x, 0x%08x, 0x%08x}", $$i{code}, $$i{utf8}, $$i{utf8_second});
|
printf($out "\n {0x%04x, 0x%08x, 0x%08x}", $i->{code}, $i->{utf8}, $i->{utf8_second});
|
||||||
$last_comment = "$$i{comment}";
|
$last_comment = "$i->{comment}";
|
||||||
}
|
}
|
||||||
print($out "\t/* $last_comment */") if ($verbose);
|
print($out "\t/* $last_comment */") if ($verbose);
|
||||||
print $out "\n};\n";
|
print $out "\n};\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user