summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authorMystery Man 535 <uid535@mandriva.org>2002-12-03 20:02:29 +0000
committerMystery Man 535 <uid535@mandriva.org>2002-12-03 20:02:29 +0000
commit6eb04547105e92f777b167c83d9cf2113b84b941 (patch)
tree9c89e726365ca895940a9f7e0be3a1bac274dc01 /perl-install/common.pm
parent289a674b450b2ea2ddbd02577c88d8db44e02403 (diff)
downloaddrakx-6eb04547105e92f777b167c83d9cf2113b84b941.tar
drakx-6eb04547105e92f777b167c83d9cf2113b84b941.tar.gz
drakx-6eb04547105e92f777b167c83d9cf2113b84b941.tar.bz2
drakx-6eb04547105e92f777b167c83d9cf2113b84b941.tar.xz
drakx-6eb04547105e92f777b167c83d9cf2113b84b941.zip
workaround perl sprintf bug when some parameters are utf8 and some not
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 0e431cbe4..ce86aa4a6 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -25,9 +25,16 @@ $SECTORSIZE = 512;
#-#####################################################################################
+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 N_ { $_[0] }