diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 07:52:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 07:52:47 +0000 |
commit | dea2732b94fda80c33db77ed827df1aca348778d (patch) | |
tree | 1c6ed3af93a7164b6ca8144f9d35a3153f6574a4 /lib/Locale/Po4a/Po.pm | |
parent | Releasing progress-linux version 0.72-1~progress7.99u1. (diff) | |
download | po4a-dea2732b94fda80c33db77ed827df1aca348778d.tar.xz po4a-dea2732b94fda80c33db77ed827df1aca348778d.zip |
Merging upstream version 0.73.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | lib/Locale/Po4a/Po.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Locale/Po4a/Po.pm b/lib/Locale/Po4a/Po.pm index d87a145..e5d0253 100644 --- a/lib/Locale/Po4a/Po.pm +++ b/lib/Locale/Po4a/Po.pm @@ -541,6 +541,9 @@ sub write { or croak wrap_mod( "po4a::po", dgettext( "po4a", "Cannot write to %s: %s" ), $filename, $! ); } + # Some old perl versions qwak when the encoding is only set to utf. We need to first reset it to raw before setting utf8 again. Not sure why it's so. + binmode( $fh, ':raw' ); + binmode( $fh, ':utf8' ); print $fh "" . format_comment( $self->{header_comment}, "" ) if length( $self->{header_comment} ); @@ -1537,7 +1540,6 @@ sub canonize { return $text; } - # Wraps the string. We don't use Text::Wrap since it mangles whitespace at the # end of the split line. # @@ -1549,7 +1551,7 @@ sub canonize { # - The extra length allowed for the first line. Default: -10 (which means it # will be wrapped 10 characters shorter). sub wrap { - my $text = shift; + my $text = shift; return "0" if ( $text eq '0' ); my $col = shift || 76; my $first_shift = shift || -10; |