aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-01-08 11:48:41 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-01-08 11:48:41 +0000
commitdf371447450ccd39b7e8a08871b74fc4b7b2d121 (patch)
tree2808d870b609119afa313b0acd84a32f6c89f384
parentfc9c1fbe9ef2fc1dd7a9d75b5c205e4d743a4f35 (diff)
downloadrpmdrake-df371447450ccd39b7e8a08871b74fc4b7b2d121.tar
rpmdrake-df371447450ccd39b7e8a08871b74fc4b7b2d121.tar.gz
rpmdrake-df371447450ccd39b7e8a08871b74fc4b7b2d121.tar.bz2
rpmdrake-df371447450ccd39b7e8a08871b74fc4b7b2d121.tar.xz
rpmdrake-df371447450ccd39b7e8a08871b74fc4b7b2d121.zip
perl's sprintf is bugged when parts of the SV's are UTF8, parts not
-rwxr-xr-xgrpmi/grpmi.pl8
-rw-r--r--rpmdrake.pm8
2 files changed, 14 insertions, 2 deletions
diff --git a/grpmi/grpmi.pl b/grpmi/grpmi.pl
index 3783ce3d..c01bee24 100755
--- a/grpmi/grpmi.pl
+++ b/grpmi/grpmi.pl
@@ -34,9 +34,15 @@ sub translate {
my ($s) = @_;
$s ? c::dgettext('grpmi', $s) : '';
}
+sub sprintf_fixutf8 {
+ my $need_upgrade;
+ $need_upgrade |= to_bool(c::is_tagged_utf8($_)) + 1 foreach @_;
+ if ($need_upgrade == 3) { c::upgrade_utf8($_) foreach @_ };
+ sprintf shift, @_;
+}
sub _ {
my $s = shift @_; my $t = translate($s);
- sprintf $t, @_;
+ sprintf_fixutf8 $t, @_;
}
sub mexit { ugtk2::exit(undef, @_) }
diff --git a/rpmdrake.pm b/rpmdrake.pm
index 254562e3..ae335e27 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -45,9 +45,15 @@ sub translate {
my ($s) = @_;
$s ? c::dgettext('rpmdrake', $s) : '';
}
+sub sprintf_fixutf8 {
+ my $need_upgrade;
+ $need_upgrade |= to_bool(c::is_tagged_utf8($_)) + 1 foreach @_;
+ if ($need_upgrade == 3) { c::upgrade_utf8($_) foreach @_ };
+ sprintf shift, @_;
+}
sub N {
my $s = shift @_; my $t = translate($s);
- sprintf $t, @_;
+ sprintf_fixutf8 $t, @_;
}
sub myexit { ugtk2::exit(undef, @_) }