[Po4a-commits] "po4a/lib/Locale/Po4a Po.pm,1.98,1.99"

Denis Barbier barbier-guest at alioth.debian.org
Tue Jul 20 18:24:35 UTC 2010


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory alioth:/tmp/cvs-serv12469/lib/Locale/Po4a

Modified Files:
	Po.pm 
Log Message:
When gettextize() fails, recode $trans into current charset before printing it on stderr


Index: Po.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Po.pm,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- Po.pm	17 Apr 2010 08:42:38 -0000	1.98
+++ Po.pm	20 Jul 2010 18:24:32 -0000	1.99
@@ -635,6 +635,13 @@
         #
         if ($typeorig ne $typetrans){
             $pores->write("gettextization.failed.po");
+            eval {
+               # Recode $trans into current charset, if possible
+               require I18N::Langinfo;
+               I18N::Langinfo->import(qw(langinfo CODESET));
+               my $codeset = langinfo(CODESET());
+               Encode::from_to($trans, $potrans->get_charset, $codeset);
+            };
             die wrap_msg(dgettext("po4a",
                          "po4a gettextization: Structure disparity between ".
                          "original and translated files:\n".




More information about the Po4a-commits mailing list