Bug 266719 - Amarok fails to play songs that contain special characters when using phonon-vlc
Summary: Amarok fails to play songs that contain special characters when using phonon-vlc
Status: RESOLVED FIXED
Alias: None
Product: phonon-backend-vlc
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Archlinux Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-20 12:27 UTC by thoebert
Modified: 2011-05-07 10:21 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.4


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description thoebert 2011-02-20 12:27:29 UTC
Version:           4.4.4 (KDE 4.6.x) (using KDE 4.6.0) 
OS:                Linux

Amarok skips the tracks from the album Ænima when phonon backend is set to vlc. With gstreamer it works fine.

Reproducible: Always

Steps to Reproduce:
Set the phonon backend to vlc. Place a file that contains special characters in its name or path in your collection. Try to play it.

Actual Results:  
Amarok skips this track and goes to the next

Expected Results:  
Amarok should play this track
Comment 1 Harald Sitter 2011-02-20 13:33:02 UTC
What system encoding do you use?
Comment 2 thoebert 2011-02-20 14:28:20 UTC
$ locale
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=


The music is stored on an etx4 partition.
Comment 3 Harald Sitter 2011-02-24 09:22:45 UTC
This bug is rather weird I must say.

http://www.fileformat.info/info/unicode/char/00C6/index.htm

Encoding with LANG=de_DE.UTF-8:
> PHONON-VLC BEGIN: void Phonon::VLC::MediaObject::loadMedia(const QString&) 
> PHONON-VLC   loading: "file:///home/me/Ænima.mp3" 
> PHONON-VLC   loading encoded: "file:///home/me/%C6nima.mp3" 
> PHONON-VLC END__: void Phonon::VLC::MediaObject::loadMedia(const QString&) [Took: 0s]

So. The character is actually U+00C6 and thus %C6 ought to be the appropriate encoding on a unicode system. VLC however refuses to decode it properly.

If however LANG=C:
> PHONON-VLC BEGIN: void Phonon::VLC::MediaObject::loadMedia(const QString&) 
> PHONON-VLC   loading: "file:///home/me/Ænima.mp3" 
> PHONON-VLC   loading encoded: "file:///home/me/%C3%86nima.mp3" 
> PHONON-VLC END__: void Phonon::VLC::MediaObject::loadMedia(const QString&) [Took: 0s] 

libvlc succssfully decodes %C3%86... equally if you force %C3%86 manually on de_DE.UTF-8 it will still be decoded properly.

My best guess right now is that it is a bug in libvlc, needs some looking into though.

Oh, actually I just noticed something... if we encode a local8bit version of the string it spits out %C3%86, maybe we should use that... well, needs testing and looking into now :)
Comment 4 Harald Sitter 2011-02-24 09:54:06 UTC
Found the issue, we were encoding at one point, then converted to UTF8 and then wrongly encoded at another point (just before percent encoding the whole beast).
Comment 5 Harald Sitter 2011-02-24 10:09:43 UTC
Git commit 28ac4780f879bca6df3e67c49a2a164993430361 by Harald Sitter.
Committed on 24/02/2011 at 10:05.
Pushed by sitter into branch 'master'.

A nice approach to fix file encoding problems a bit more...

* loadMedia by default wants an encoded QBA now
* there also is an overload for QString which simply does toUtf8
* local files are now encoded to local 8-bit and along with remote urls percent encoded to QBA and passed to loadMedia

This *should* fix encoding problems proper now. It is however to be noted that Phonon 4.5's Mrl class will deal with these issues at better scale.

BUG: 266719

M  +1    -1    vlc/libvlc.h     
M  +17   -18   vlc/mediaobject.cpp     
M  +15   -0    vlc/mediaobject.h     

http://commits.kde.org/phonon-vlc/28ac4780f879bca6df3e67c49a2a164993430361
Comment 6 Myriam Schweingruber 2011-04-27 21:34:03 UTC
Reassigning to the new bugzilla product for better bug tracing of the various
backends. Sorry for the noise.