summaryrefslogtreecommitdiffstats
path: root/gurpmi
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2014-01-24 08:15:53 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2014-01-24 08:15:53 +0100
commite59e990ec91a49b04d5382194a93c16501f971c9 (patch)
treee9f1165c423ef3f594249aaec3e0c826c0b08f48 /gurpmi
parentea927d73e6c1218a44d18efae45dbb5ac8a06821 (diff)
downloadurpmi-e59e990ec91a49b04d5382194a93c16501f971c9.tar
urpmi-e59e990ec91a49b04d5382194a93c16501f971c9.tar.gz
urpmi-e59e990ec91a49b04d5382194a93c16501f971c9.tar.bz2
urpmi-e59e990ec91a49b04d5382194a93c16501f971c9.tar.xz
urpmi-e59e990ec91a49b04d5382194a93c16501f971c9.zip
fix garbaged UTF-8 in file name arguments (mga#12407)
@ARGV encoding is changed after calling Gtk3->init
Diffstat (limited to 'gurpmi')
-rwxr-xr-xgurpmi7
1 files changed, 7 insertions, 0 deletions
diff --git a/gurpmi b/gurpmi
index 8dfd79d4..bc66e877 100755
--- a/gurpmi
+++ b/gurpmi
@@ -10,6 +10,8 @@ BEGIN { #- set up a safe path and environment
delete @ENV{qw(ENV BASH_ENV IFS CDPATH)};
}
+use utf8 'valid';
+use Encode '_utf8_on';
use Gtk3;
use gurpmi;
use urpm::util 'basename';
@@ -27,6 +29,11 @@ my ($srpms, $rpms) = ([], []);
my ($mainw, $mainbox);
my @all_rpms = gurpmi::parse_command_line();
+# Gtk3->init will change @ARGV encoding (mga#12407):
+foreach (@ARGV) {
+ utf8::valid($_) && Encode::_utf8_on($_);
+}
+
#- Now, the graphical stuff.
Gtk3->init;