I noticed that xdg-open doesn't handle percent encoded urls. For example, these lines will succeed (provided the files exist):xdg-open /home/sashoalm/Has Spaces.txtxdg-open file:///home/sashoalm/NoSpaces.txtBut this one will fail:xdg-open file:///home/sashoalm/Has%20Spaces.txtEdit: This is my version of xdg-utils sashoalm@aspire:~$ apt-cache policy xdg-utilsxdg-utils:  Installed: 1.1.0~rc1+git20111210-6+deb7u1  Candidate: 1.1.0~rc1+git20111210-6+deb7u1  Version table: *** 1.1.0~rc1+git20111210-6+deb7u1 0        500 http://ftp.bg.debian.org/debian/ wheezy/main amd64 Packages        100 /var/lib/dpkg/statusEdit 2: This is the trace:sashoalm@aspire:~$ bash -x xdg-open file:///home/sashoalm/Has%20Spaces.txt + check_common_commands file:///home/sashoalm/Has%20Spaces.txt+ '[' 1 -gt 0 ']'+ parm=file:///home/sashoalm/Has%20Spaces.txt+ shift+ case $parm in+ '[' 0 -gt 0 ']'+ '[' -z '' ']'+ unset XDG_UTILS_DEBUG_LEVEL+ '[' 0 -lt 1 ']'+ xdg_redirect_output=' > /dev/null 2> /dev/null'+ '[' xfile:///home/sashoalm/Has%20Spaces.txt '!=' x ']'+ url=+ '[' 1 -gt 0 ']'+ parm=file:///home/sashoalm/Has%20Spaces.txt+ shift+ case $parm in+ '[' -n '' ']'+ url=file:///home/sashoalm/Has%20Spaces.txt+ '[' 0 -gt 0 ']'+ '[' -z file:///home/sashoalm/Has%20Spaces.txt ']'+ detectDE+ unset GREP_OPTIONS+ '[' -n LXDE ']'+ case ${XDG_CURRENT_DESKTOP} in+ DE=lxde+ '[' xlxde = x ']'+ '[' xlxde = x ']'+ '[' xlxde = x ']'+ '[' xlxde = xgnome ']'+ '[' xlxde = x ']'+ DEBUG 2 'Selected DE lxde'+ '[' -z '' ']'+ return 0+ '[' x = x ']'+ BROWSER=www-browser:links2:elinks:links:lynx:w3m+ '[' -n :0 ']'+ BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:www-browser:links2:elinks:links:lynx:w3m+ case $DE in+ open_lxde file:///home/sashoalm/Has%20Spaces.txt+ echo file:///home/sashoalm/Has%20Spaces.txt+ grep -q '^file://'++ echo file:///home/sashoalm/Has%20Spaces.txt++ sed 's%^file://%%'+ local file=/home/sashoalm/Has%20Spaces.txt+ echo /home/sashoalm/Has%20Spaces.txt+ grep -q '^/'+ pcmanfm /home/sashoalm/Has%20Spaces.txt+ '[' 0 -eq 0 ']'+ exit_success+ '[' 0 -gt 0 ']'+ exit 0
xdg-open doesn't handle percent encoded file:/// urls with LXDE
debian;lxde;xdg open
If you are using an LXDE desktop environment, xdg-open opens file:// URLS with the pcmanfm program. It strips the file:// part of the URL and calls pcmanfm with the remaining part, since pcmanfm supports only normal paths as arguments, not URLs.xdg-open does not do any other replacements, so %20 is not translated into a space. This is a bug (feel free to open a bug report for this in Debian).A fix is described below.For other desktop environments, the open programs support correctly file:// URLs.Workaround:Unset some environment variables, so that xdg-open uses the generic open handler which supports all needed replacements:XDG_CURRENT_DESKTOP= DESKTOP_SESSION= xdg-open /home/sashoalm/Has Spaces.txtBugfix:Copy the xdg-open script to /usr/local/bin (so that it is not overwritten by upgrading your system) and add the linefile=$(printf $(echo $file | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g'))to the xdg-open script above the # handle relative paths comment line.Bugfix 2:Or simply replace replace detectDE() with:detectDE(){    DE=gnome}