From 95615ebc66c00bdb73d20a927f6eb5bd777dc2a6 Mon Sep 17 00:00:00 2001 From: nobuyuki morita Date: Sun, 2 Dec 2012 02:44:24 +0000 Subject: fix #690331 copypage and stattrans cleaning CVS version numbers copypage.pl: 1.41 -> 1.42 --- copypage.pl | 105 +----------------------------------------------------------- 1 file changed, 1 insertion(+), 104 deletions(-) (limited to 'copypage.pl') diff --git a/copypage.pl b/copypage.pl index cdaf5175b23..982fe168ea7 100755 --- a/copypage.pl +++ b/copypage.pl @@ -25,14 +25,6 @@ use Local::VCS qw(vcs_file_info); use File::Temp qw/tempfile/; use Getopt::Std; - -# Declare variables only used in references to avoid warnings -use vars qw(@iso_8859_2_compat @iso_8859_3_compat @iso_8859_4_compat - @iso_8859_5_compat @iso_8859_6_compat @iso_8859_7_compat - @iso_8859_8_compat @iso_8859_9_compat @iso_8859_10_compat - @iso_8859_13_compat @iso_8859_14_compat @iso_8859_15_compat - @iso_8859_16_compat); - # Get configuration # Read first two valid lines from language.conf if (open CONF, ") - { - if (s/^-D CHARSET=//) - { - $recode = 1 unless /^utf-8$/i; - if ($recode && /^iso-8859-([0-9]+)$/) - { - my $compattablename = 'iso_8859_' . $1 . '_compat'; - $compat = \@{$compattablename} if defined @{$compattablename}; - } - last; - } - } -} - # Loop over command line foreach $page (@ARGV) { # Check if valid source if ($page =~ /wml$/ || $page =~ /src$/) { - ©($page, $recode, $compat); + ©($page); } else { @@ -181,8 +116,6 @@ foreach $page (@ARGV) sub copy { my $page = shift; - my $recodelatin1 = shift; - my $compattable = shift; print "Processing $page...\n"; # Remove english/ from path @@ -294,30 +227,6 @@ sub copy } else { - # Transform the string into a string that is fit for the encoding - # of the output language. We do that by first converting any - # SGML entities in the input stream into 8-bit ISO 8859-1 - # encoding, and then convert extended characters (back) into - # entities if necessary for the target encoding. - - # Decode - s/(&[^#;]+;)/&decodeentity($1)/ge; - s/&#(1[6-9][0-9]|2[0-4][0-9]|25[0-5]);/chr($1)/ge; - - # Encode - if (defined $compattable) - { - # Output encoding is in part compatible with ISO 8859-1, only - # convert incompatible characters into entities. - s/([\xA0-\xFF])/$$compattable[ord($1)-160]?$1:$entities[ord($1)-160]/ge; - } - elsif ($recodelatin1) - { - # Output encoding is incompatible with ISO 8859-1, convert all - # 8-bit characters into entities. - s/([\xA0-\xFF])/$entities[ord($1)-160]/ge; - } - print DST $_; } } @@ -339,18 +248,6 @@ sub copy if defined $dsttitle; } -# Return the ISO-8859-1 character that corresponds to the given entity -sub decodeentity -{ - my $ent = shift; - # Start at one to avoid decoding   - for (my $i = 1; $i < $#entities; ++ $i) - { - return chr($i + 160) if $entities[$i] eq $ent; - } - return $ent; -} - # Find for old translations in the CVS Attic sub find_files_attic { -- cgit v1.2.3