From 8265e240c71f71e21067bea8fd4ee3b24136ffd4 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 1 Feb 2005 13:39:21 +0000 Subject: Convert strings to UTF-8 before display in gurpmi and gurpmi2. (bug 13296) --- gurpmi.pm | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'gurpmi.pm') diff --git a/gurpmi.pm b/gurpmi.pm index af18242b..06a6aa6d 100644 --- a/gurpmi.pm +++ b/gurpmi.pm @@ -5,14 +5,12 @@ package gurpmi; #- changing only LC_COLLATE will have no effect. use POSIX qw(setlocale LC_ALL LC_COLLATE); use locale; -BEGIN { - my $collation_locale = $ENV{LC_ALL}; - if ($collation_locale) { - $collation_locale =~ /UTF-8/ or setlocale(LC_ALL, "$collation_locale.UTF-8"); - } else { - $collation_locale = setlocale(LC_COLLATE); - $collation_locale =~ /UTF-8/ or setlocale(LC_COLLATE, "$collation_locale.UTF-8"); - } +my $collation_locale = $ENV{LC_ALL}; +if ($collation_locale) { + $collation_locale =~ /UTF-8/ or setlocale(LC_ALL, "$collation_locale.UTF-8"); +} else { + $collation_locale = setlocale(LC_COLLATE); + $collation_locale =~ /UTF-8/ or setlocale(LC_COLLATE, "$collation_locale.UTF-8"); } use urpm; @@ -20,7 +18,7 @@ use strict; use Exporter; our @ISA = qw(Exporter); -our @EXPORT = qw(fatal but quit add_button_box new_label); +our @EXPORT = qw(fatal but quit add_button_box new_label N); sub usage () { print STDERR <