X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/22b2ad7f224ef0a3e160ed9f302274d2f625f240..72ad92fd:/scripts/locales.pl diff --git a/scripts/locales.pl b/scripts/locales.pl index 2174c2d81..fa787a24b 100755 --- a/scripts/locales.pl +++ b/scripts/locales.pl @@ -85,6 +85,9 @@ if (-f "$locales_dir/lost") { unlink "$locales_dir/lost"; } +my $charset = slurp("$locales_dir/charset") || 'utf-8'; +chomp $charset; + my %old_texts = %{ $self->{texts} || {} }; map({ handle_file($_, $bindir); } @progfiles); @@ -158,7 +161,7 @@ EOL EOL $LOST_HEADER = <', $file or die "$! : $file"; - print $fh "#!/usr/bin/perl\n# -*- coding: iso-8859-15; -*-\n\n"; + my $emacs_charset = lc $charset; + + print $fh "#!/usr/bin/perl\n# -*- coding: $emacs_charset; -*-\n# vim: fenc=$charset\n\n"; print $fh $header, "\n" if $header; print $fh "$data_name = $delim[0]\n" if $data_name; @@ -608,6 +613,11 @@ sub generate_file { close $fh; } +sub slurp { + my $file = shift; + do { local ( @ARGV, $/ ) = $file; <> } +} + __END__ =head1 NAME