Fix charset tables generation: remove directory part from filename. Uppercase charset names
This commit is contained in:
parent
1f599d707c
commit
50cf39d3d3
@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
# $Id$
|
# $Id$
|
||||||
|
# xlatcfg.pl
|
||||||
# Generate xlatcharset directives for the config of Golded+
|
# Generate xlatcharset directives for the config of Golded+
|
||||||
# using Golded+ charset conversion modules in text form (*.chs).
|
# using Golded+ charset conversion modules in text form (*.chs).
|
||||||
#
|
#
|
||||||
@ -36,9 +37,10 @@ HEAD
|
|||||||
print "Found " . ($#files+1) . " *.CHS files in $dir\n";
|
print "Found " . ($#files+1) . " *.CHS files in $dir\n";
|
||||||
|
|
||||||
foreach my $f (@files) {
|
foreach my $f (@files) {
|
||||||
if( ! open( IN, "$dir/$f" ) ){ print STDERR "Can't open file '$dir/$f': $!\n"; next; }
|
if( ! open( IN, "$f" ) ){ print STDERR "Can't open file '$f': $!\n"; next; }
|
||||||
print "Proceed $dir/$f\n";
|
print "Proceed $f\n";
|
||||||
my $count=1, $fromchs, $tochs;
|
my $count=1, $fromchs, $tochs;
|
||||||
|
$f =~ s%.*/%%g;
|
||||||
while( <IN> ) {
|
while( <IN> ) {
|
||||||
next if( /^;/ ); # comment
|
next if( /^;/ ); # comment
|
||||||
next if( m%^//% ); # comment
|
next if( m%^//% ); # comment
|
||||||
@ -46,9 +48,9 @@ foreach my $f (@files) {
|
|||||||
chomp;
|
chomp;
|
||||||
next if( m%^$% ); # empty line
|
next if( m%^$% ); # empty line
|
||||||
if( m%^([^\s]+)% ) {
|
if( m%^([^\s]+)% ) {
|
||||||
if($count==4){ $fromchs=$1; }
|
if($count==4){ $fromchs=uc($1); }
|
||||||
elsif($count==5){
|
elsif($count==5){
|
||||||
$tochs=$1;
|
$tochs=uc($1);
|
||||||
printf OUT "XLATCHARSET %-12s %-12s %s\n", $fromchs, $tochs, $f;
|
printf OUT "XLATCHARSET %-12s %-12s %s\n", $fromchs, $tochs, $f;
|
||||||
if($fromchs =~ /-/) {
|
if($fromchs =~ /-/) {
|
||||||
( my $temp = $fromchs ) =~ s/-//g ;
|
( my $temp = $fromchs ) =~ s/-//g ;
|
||||||
|
Reference in New Issue
Block a user