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

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sat Oct 7 19:43:37 UTC 2006


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

Modified Files:
	Po.pm 
Log Message:
Convert UTF-8 strings to Perl's "logical character" before wrapping the
text. This helps the length calculation needed for wrapping lines.


Index: Po.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Po.pm,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- Po.pm	5 May 2006 22:01:44 -0000	1.63
+++ Po.pm	7 Oct 2006 19:43:35 -0000	1.64
@@ -776,7 +776,13 @@
     }
 
     if ($opt{'wrap'}) {
-	$res=wrap ($res, $opt{'wrapcol'} || 76);
+        if ($self->get_charset =~ /^utf-8$/i) {
+            $res=Encode::decode_utf8($res);
+            $res=wrap ($res, $opt{'wrapcol'} || 76);
+            $res=Encode::encode_utf8($res);
+        } else {
+            $res=wrap ($res, $opt{'wrapcol'} || 76);
+        }
     }
 #    print STDERR "Gettext >>>$text<<<(escaped=$esc_text)=[[[$res]]]\n\n";
     return $res;




More information about the Po4a-commits mailing list