summaryrefslogtreecommitdiffstats
path: root/urpm/msg.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-02-24 18:58:12 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-02-24 18:58:12 +0000
commitf530cf57f4aad63b8b407b422463ff73bb44fd25 (patch)
treedd73158461f87ea838a57691d1a38ecda20eb068 /urpm/msg.pm
parent9a6b37afdd6bd69407c7dbe46c2a4213af8e0a11 (diff)
downloadurpmi-f530cf57f4aad63b8b407b422463ff73bb44fd25.tar
urpmi-f530cf57f4aad63b8b407b422463ff73bb44fd25.tar.gz
urpmi-f530cf57f4aad63b8b407b422463ff73bb44fd25.tar.bz2
urpmi-f530cf57f4aad63b8b407b422463ff73bb44fd25.tar.xz
urpmi-f530cf57f4aad63b8b407b422463ff73bb44fd25.zip
Fall back to using locale(1) if I18N::Langinfo is not available.
Diffstat (limited to 'urpm/msg.pm')
-rw-r--r--urpm/msg.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/urpm/msg.pm b/urpm/msg.pm
index 44f1280d..65d5cf58 100644
--- a/urpm/msg.pm
+++ b/urpm/msg.pm
@@ -17,6 +17,10 @@ eval {
I18N::Langinfo->import(qw(langinfo CODESET));
$codeset = langinfo(CODESET()); # note the ()
};
+defined $codeset or eval {
+ (undef, $codeset) = `/usr/bin/locale -c charmap`;
+ chomp $codeset;
+};
sub from_utf8_full { Locale::gettext::iconv($_[0], "UTF-8", $codeset) }
sub from_utf8_dummy { $_[0] }
@@ -89,7 +93,7 @@ sub toMb {
int $nb + 0.5;
}
-sub localtime2changelog { scalar(localtime($_[0])) =~ /(.*) \S+ (\d{4})$/ && "$1 $2" };
+sub localtime2changelog { scalar(localtime($_[0])) =~ /(.*) \S+ (\d{4})$/ && "$1 $2" }
1;