From e59e990ec91a49b04d5382194a93c16501f971c9 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 24 Jan 2014 08:15:53 +0100 Subject: fix garbaged UTF-8 in file name arguments (mga#12407) @ARGV encoding is changed after calling Gtk3->init --- NEWS | 2 ++ gurpmi | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/NEWS b/NEWS index a55b0386..b12e71ac 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,7 @@ - do not exec pkexec but run it so it has a parent process to fix double fork issues mga#11184 mga#12364 +- gurpmi: + o fix garbaged UTF-8 in file name arguments (mga#12407) Version 7.30 - 5 December 2013 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; -- cgit v1.2.1