[win32] Tags missing on files with non-English names

Bug #666763 reported by Johannes Sasongko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
Medium
Johannes Sasongko

Bug Description

In Windows, Exaile can't read tags from files with non-English filenames.

Related branches

Revision history for this message
Johannes Sasongko (sjohannes) wrote :

This is the other side of the problem I documented in metadata/_matroska.py:

    if sys.platform == 'win32' and '://' not in location:
        # XXX: This is most likely a bug in the Win32 GIO port; it converts
        # paths into UTF-8 and requires them to be specified in UTF-8 as well.
        # Here we decode the path according to the FS encoding to get the
        # Unicode representation first. If the path is in a different encoding,
        # this step will fail.
        location = location.decode(sys.getfilesystemencoding()).encode('utf-8')

(I'm not sure this is exclusive to win32, but I have no easy way to check other systems where the filesystem encoding is not UTF-8.)

Anyway, back to this particular case, we want to get the original URI/path but all we have is a URL that was pre-encoded with UTF-8. For example, a file named ú (FA in my encoding, C3 BA in UTF-8) will have %C3%BA in the URI, which is wrong. How did we get %C3%BA in the first place? I'm not sure at the moment; possibly from gio.File.enumerate_children.

The crazy thing is, this only affects interaction with non-GIO stuff (namely, Mutagen). GIO itself happily lives with the problem (for example, GStreamer plays the URI just fine), so I don't know if this is actually a bug or if it's intended.

I'm going to try working around the problem by re-encoding the URI/path with sys.getfilesystemencoding().

Revision history for this message
Johannes Sasongko (sjohannes) wrote :

OK, for now I'm not re-encoding the path but just decoding it from UTF-8 str into unicode. It seems to work in my system; hopefully it doesn't break in Linux.

Changed in exaile:
milestone: none → 0.3.3.0
status: Confirmed → Fix Committed
Changed in exaile:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.