4 # The i18n Unicode Encoding Utility
6 # Copyright (C) 2001 Free Software Foundation.
8 # This library is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of the
11 # License, or (at your option) any later version.
13 # This script is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this library; if not, write to the Free Software
20 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 # Authors: Kenneth Christiansen <kenneth@gnu.org>
29 print "You must specify the language\n";
35 ## example: "Content-Type: text/plain; charset=ISO-8859-1\n"
36 if (/Content-Type\:.*charset=(.*)\\n/) {
37 $encoding_code_orig = $1;
44 print "Converting from $encoding_code_orig\n" if $VERBOSE;
46 my $extern_conv="iconv --from=$encoding_code_orig "
47 ."--to=UTF-8 $LANG.po > $LANG.po-1";
55 open (IN
, "<$LANG.po-1") || die "can't open $LANG.po-1: $!";
59 $source_orig =~ s/Content-Type\:(.*)$encoding_code_orig/Content-Type\:$1UTF-8/;
63 open OUT
, ">$LANG.po-1";
64 print OUT
$source_orig;