[Po4a-commits] "po4a/lib/Locale/Po4a Po.pm,1.64,1.65"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sat Oct 7 20:33:30 UTC 2006


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv9459/lib/Locale/Po4a

Modified Files:
	Po.pm 
Log Message:
Fix another wrap / length calculation issue, this time for the generation
of the PO.


Index: Po.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Po.pm,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- Po.pm	7 Oct 2006 19:43:35 -0000	1.64
+++ Po.pm	7 Oct 2006 20:33:28 -0000	1.65
@@ -298,8 +298,15 @@
 	    if    defined($self->{po}{$msgid}{'flags'})
 	       && length ($self->{po}{$msgid}{'flags'});
 
-	$output .= "msgid ".quote_text($msgid)."\n";
-	$output .= "msgstr ".quote_text($self->{po}{$msgid}{'msgstr'})."\n";
+	if ($self->get_charset =~ /^utf-8$/i) {
+	    my $msgstr = Encode::decode_utf8($self->{po}{$msgid}{'msgstr'});
+	    $msgid = Encode::decode_utf8($msgid);
+	    $output .= Encode::encode_utf8("msgid ".quote_text($msgid)."\n");
+	    $output .= Encode::encode_utf8("msgstr ".quote_text($msgstr)."\n");
+	} else {
+	    $output .= "msgid ".quote_text($msgid)."\n";
+	    $output .= "msgstr ".quote_text($self->{po}{$msgid}{'msgstr'})."\n";
+	}
 	print $fh $output;
     }   
 #    print STDERR "$fh";




More information about the Po4a-commits mailing list