Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the File-DesktopEntry CPAN distribution.

Report information
The Basics
Id: 76843
Status: resolved
Priority: 0/
Queue: File-DesktopEntry

People
Owner: Nobody in particular
Requestors: mmaslano [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.04
Fixed in: 0.20



Subject: exec/run calls don't handle CJK filenames well
convert $_ to native before substitude with native filename. The exec()/run() subroutines in DesktopEntry.pm cannot handle CJK filenames, under UTF-8 locale. It can be see with mimeopen which use DesktopEntry to handle open files with .desktop format. use a CJK filename like "我的图片.jpg", with mimeopen: $ mimeopen 我的图片.jpg The filename passed to the pic viewer will be screw up, like some latin1@#$AS.jpg. The cause is that the regex substitution in the parse_Exec() function mixed utf-8 and native string at line 337: else { # expand with word ( e.g. --input=%f ) my $bad; s/\%(.)/ ($1 eq '%') ? '%' : ($1 eq 'f') ? (_paths(@argv))[0] : ($1 eq 'u') ? (_uris(@argv) )[0] : ($1 eq 'd') ? (_dirs(@argv) )[0] : ($1 eq 'c') ? $self->get('Name') : ($1 eq 'k') ? $$self{file} : '' ; /eg; push @exec, $_; } Where the argv is in byte encoding and $_ is in UTF_8, when mixed in regex, the output will be garbage for non-latin1 argv. A possible fix is to convert $_ to byte string before doing the substitution. The original bug report was for Fedora-15 from MozBug: https://bugzilla.redhat.com/show_bug.cgi?id=816809
Subject: DesktopEntry.patch
--- DesktopEntry.pm.orig 2012-04-27 12:37:49.678506235 +0800 +++ DesktopEntry.pm 2012-04-27 12:39:38.411513568 +0800 @@ -1,6 +1,7 @@ package File::DesktopEntry; use strict; +use Encode; use vars qw/$AUTOLOAD/; use Carp; use File::Spec; @@ -333,6 +334,7 @@ push @exec, '--icon', $icon if defined($icon); } else { # expand with word ( e.g. --input=%f ) + $_ = encode_utf8($_); my $bad; s/\%(.)/ ($1 eq '%') ? '%' :
This is now fixed in version 0.20 on CPAN.