From 15a685fb206da461238692f094fe77a04f94d598 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 22 Jul 2002 18:48:26 +0000 Subject: - use new PerlIO instead of iconv - transliterate by hand &ndash and é - move "use utf8" at top - fix the spaces between entities (eg: &company-microsoft; &os-windows; must not be MicrosoftWindows) --- perl-install/share/po/help_xml2pm.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'perl-install') diff --git a/perl-install/share/po/help_xml2pm.pl b/perl-install/share/po/help_xml2pm.pl index 932b5943f..37629a95d 100755 --- a/perl-install/share/po/help_xml2pm.pl +++ b/perl-install/share/po/help_xml2pm.pl @@ -2,6 +2,7 @@ use XML::Parser; use MDK::Common; +use utf8; my $help; my $dir = "doc/manual/literal/drakx"; @@ -30,8 +31,7 @@ foreach my $lang (keys %helps) { print "Now transforming: $lang\n"; local *F; my ($charset) = cat_("$lang.po") =~ /charset=([^\\]+)/ or die "missing charset in $lang.po\n"; - open F, "| iconv -f utf8 -t $charset//TRANSLIT > help-$lang.pot"; - #open F, "|cat - > help-$lang.pot"; + open F, ">:encoding($charset)", "help-$lang.pot"; print F "\n"; foreach my $id (keys %{$helps{$lang}}) { $base->{$id} or die "$lang:$id doesn't exist in english\n"; @@ -48,7 +48,7 @@ unlink(".memdump"); sub save_help { my ($help) = @_; local *F; - open F, "| LC_ALL=fr iconv -f utf8 -t ascii//TRANSLIT > ../../help.pm"; + open F, ">:encoding(ascii)", "../../help.pm"; print F q{package help; use common; @@ -79,6 +79,7 @@ sub rewrite1 { foreach ($tree) { s/\s+/ /gs; s/"/\\"/g; + tr/\x{2013}\x{00e9}/-e/; } push @l, $tree } elsif ($tag eq 'screen') { @@ -104,7 +105,6 @@ sub find { } sub rewrite2 { - use utf8; my ($tree, $lang) = @_; our $i18ned_open_text_quote = $ {{ fr => "« ", @@ -139,7 +139,7 @@ sub rewrite2_ { my $text = do { my @l = map { rewrite2_($_) } @{$tree->{children}}; my $text = ""; - foreach (grep { !/^\s*$/ } @l) { + foreach (@l) { s/^ // if $text =~ /\s$/; $text =~ s/ $// if /^\s/; $text =~ s/\n+$// if /^\n/; -- cgit v1.2.1