[Po4a-commits] po4a/lib/Locale/Po4a Xml.pm,1.26,1.27
Jordi Vilalta
po4a-devel@lists.alioth.debian.org
Sat, 21 May 2005 15:51:14 +0000
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv5286/lib/Locale/Po4a
Modified Files:
Xml.pm
Log Message:
Append the encoding attribute if it is not defined in the <?xml> tag
(thanks to Francois Gouget <fgouget@free.fr>)
Index: Xml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Xml.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- Xml.pm 21 Mar 2005 12:58:24 -0000 1.26
+++ Xml.pm 21 May 2005 15:51:12 -0000 1.27
@@ -399,7 +399,11 @@
$self->detected_charset($in_charset);
my $out_charset=$self->get_out_charset;
- $tag =~ s/$in_charset/$out_charset/;
+ if (defined $in_charset) {
+ $tag =~ s/$in_charset/$out_charset/;
+ } else {
+ $tag.= " encoding=\"$out_charset\"";
+ }
return $tag;
}