{"action":"opened","issue":{"url":"https://api.github.com/repos/mbeijen/File-MimeInfo/issues/17","labels_url":"https://api.github.com/repos/mbeijen/File-MimeInfo/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/mbeijen/File-MimeInfo/issues/17/comments","events_url":"https://api.github.com/repos/mbeijen/File-MimeInfo/issues/17/events","html_url":"https://github.com/mbeijen/File-MimeInfo/issues/17","id":109050832,"number":17,"title":"Wrong encoding of UTF-8 encoded filenames in exec() call","user":{"login":"tbart","id":9994131,"avatar_url":"https://avatars.githubusercontent.com/u/9994131?v=3","gravatar_id":"","url":"https://api.github.com/users/tbart","html_url":"https://github.com/tbart","followers_url":"https://api.github.com/users/tbart/followers","following_url":"https://api.github.com/users/tbart/following{/other_user}","gists_url":"https://api.github.com/users/tbart/gists{/gist_id}","starred_url":"https://api.github.com/users/tbart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbart/subscriptions","organizations_url":"https://api.github.com/users/tbart/orgs","repos_url":"https://api.github.com/users/tbart/repos","events_url":"https://api.github.com/users/tbart/events{/privacy}","received_events_url":"https://api.github.com/users/tbart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-30T09:38:19Z","updated_at":"2015-09-30T09:38:19Z","closed_at":null,"body":"If I use mimeopen to open a file called \"ä.pdf\" (umlaut a encoded in UTF8), my associated application does not find the file (the error message is somewhat strange):\r\n\r\n```\r\nthomas.bartosik@tbartosik-linux:/mnt/scratch$ xdg-open ä.pdf \r\nOpening \"ä.pdf\" with Zathura  (application/pdf)\r\nexec string: zathura ä.pdf\r\nerror: Unknown file type: '(null)'\r\n```\r\n\r\nIf I uncomment\r\n```\r\n165 #print STDERR \"exec string: \".$default->parse_Exec(@ARGV).\"\\n\";\r\n```\r\neverything still looks OK on the console output.\r\n\r\nAn strace clearly shows the wrong (double?) encoding:\r\n\r\n```\r\nthomas.bartosik@tbartosik-linux:/mnt/scratch$ strace mimeopen -n ä.pdf 2>&1 | grep \"open.*pdf\"\r\nexecve(\"/usr/bin/mimeopen\", [\"mimeopen\", \"-n\", \"\\303\\244.pdf\"], [/* 43 vars */]) = 0\r\nopen(\"\\303\\244.pdf\", O_RDONLY)          = 4\r\nopen(\"/etc/fonts/conf.d/99pdftoopvp.conf\", O_RDONLY|O_CLOEXEC) = 11\r\nopen(\"/usr/lib/zathura/pdf.so\", O_RDONLY|O_CLOEXEC) = 11\r\nopen(\"/mnt/scratch/\\303\\203\\302\\244.pdf\", O_RDONLY) = -1 ENOENT (No such file or directory)\r\n```\r\n\r\nIf I add\r\n```\r\nuse utf8::all;\r\n```\r\nto mimeopen, all is well.\r\n\r\nI am not a perl programmer and don't know about possible other implications, but it works for me.\r\n\r\n\r\nVersion used:\r\n```\r\nthomas.bartosik@tbartosik-linux:/mnt/scratch$ apt-cache policy libfile-mimeinfo-perl\r\nlibfile-mimeinfo-perl:\r\n  Installed: 0.26-1\r\n  Candidate: 0.26-1\r\n  Version table:\r\n *** 0.26-1 0\r\n        500 http://debian.inode.at/debian/ jessie/main amd64 Packages\r\n        100 /var/lib/dpkg/status\r\n```\r\n\r\nEnvironment:\r\n```\r\nthomas.bartosik@tbartosik-linux:/mnt/scratch$ set | egrep \"^(LC_|LANG)\"\r\nLANG=en_US.UTF-8\r\nLC_NUMERIC=de_AT.UTF-8\r\nLC_PAPER=de_AT.UTF-8\r\n```"}}