[Portland-bugs] [Bug 30757] New: file:// URLs do not decode non-latin symbols (patch included)

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Oct 10 11:18:05 PDT 2010


https://bugs.freedesktop.org/show_bug.cgi?id=30757

           Summary: file:// URLs do not decode non-latin symbols (patch
                    included)
           Product: Portland
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: xdg-utils
        AssignedTo: portland-bugs at lists.freedesktop.org
        ReportedBy: vl409 at yandex.ru


Created an attachment (id=39324)
 --> (https://bugs.freedesktop.org/attachment.cgi?id=39324)
Implement URL decoding for non-latin symbols in file:// URLs

Attempt to open file:// URL with non-latin symbols in it leads
to failure, because no decoding happens for URL. The script
tests if file exists and gets false result, because it attempts to
find a name with stuff file this '%D0%B3%D0%BB%D0%B' in name.

Appropirate place in script is marked as 'TODO'.

For example this is what happens when i try to open local filename
with name in russian from my Qt program:

Attempt to open: QUrl( "file:///home/vl/.local/share/data/mentat/EGRP/data/01.
Назначение ЭГРП/1. Назначение гидроприводов Л.А.pdf" )
xdg-open: file
'/home/vl/.local/share/data/mentat/EGRP/data/01.%20%D0%9D%D0%B0%D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%AD%D0%93%D0%A0%D0%9F/1.%20%D0%9D%D0%B0%D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%B3%D0%B8%D0%B4%D1%80%D0%BE%D0%BF%D1%80%D0%B8%D0%B2%D0%BE%D0%B4%D0%BE%D0%B2%20%D0%9B.%D0%90.pdf'
does not exist

The xdg fails to open file, although it exists:

$ file "/home/vl/.local/share/data/mentat/EGRP/data/01. Назначение ЭГРП/1.
Назначение гидроприводов Л.А.pdf"
/home/vl/.local/share/data/mentat/EGRP/data/01. Назначение ЭГРП/1. Назначение
гидроприводов Л.А.pdf: PDF document, version 1.4

The problem can be easily fixed with suggested patch - it decodes URL using
sed, no perl/php is required.
The solution was obtained here:
http://spielwiese.la-evento.com/xelasblog/archives/23-URL-decode-und-encode-in-der-Bash.html
- thanks to unknown german man ;-)

UPD:
I reviewed CVS history of xdg-open and found that url decoding was
remvoed in Revision 1.48 with comment 'It still need some work.'

I've tested suggested solution and it really doesn't work. My patch works
at least for me well.

The patch is against gentoo's version, but applies to xdg-open rev 1.52 as well
and works.

I'd like to see this problem fixed, since it blocks the ability for user to
open files with non-latin names using standard methods.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Portland-bugs mailing list