Bug 138240 - Generic Audio device encoding
Summary: Generic Audio device encoding
Status: RESOLVED INTENTIONAL
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Media Devices (show other bugs)
Version: 1.4.4
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-02 10:52 UTC by Smirnov Dmitriy
Modified: 2008-08-07 10:40 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch to svn stable branch to remove encoded name->KURL::fromPathOrURL (2.28 KB, patch)
2007-02-11 00:14 UTC, Mook
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Smirnov Dmitriy 2006-12-02 10:52:35 UTC
Version:           1.4.4 (using KDE KDE 3.5.4)
Installed from:    SuSE RPMs
OS:                Linux

I've connected my device. When i transfer Tracks with tags on English everything's fine. But when i try to transfer files with tags in UTF-8, my transfer fails with Error: /mnt/Artist/Album/Title.ext fails. And i've got some unknown symbols in Filename. When i copy my music by Krusader everything's fine.
Comment 1 Mook 2007-01-12 12:21:11 UTC
I'm also seeing this; furthermore:
- if any directories (in the example, "Artist" or "Album") have non-ASCII, it fails
- otherwise if the file name ("Title.ext") have non-ASCII, it succeeds but the file name is incorrect.

It looks like the UTF8 name is being interpreted as a ASCII string.

I believe this is due to http://lxr.kde.org/source/extragear/multimedia/amarok/src/mediadevice/generic/genericmediadevice.cpp#665
despite KURL::fromPathOrURL taking a QString (not QCString).  Locally hacking it to not do the encodeName() seems to work better.

I think it's doing some implicit casts:
QCString(utf-8 encoded) -> const char* -> QString(const char*) which treats it as Latin-1

There appears to be more examples of this in the file.
Comment 2 Mook 2007-02-11 00:14:53 UTC
Created attachment 19609 [details]
patch to svn stable branch to remove encoded name->KURL::fromPathOrURL

This patch removes instances where an encoded name is fed to
KURL::fromPathOrURL().	This _should_ fix things, but please review carefully
as this is pretty much my first KDE/Qt related patch :)
Comment 3 Lydia Pintscher 2008-08-05 23:59:28 UTC
I am sorry but this will not get fixed in Amarok 1.4 as we are focused on Amarok 2 now.
Mook I am sorry noone ever seemed to have looked at your patch :(

Thank you for your report and work.
Comment 4 Mook 2008-08-07 06:23:29 UTC
Sadly, that seems to be the general case in lots of projects.  I even tried poking IRC at one point, but nobody seemed to be around that knew anything about actual development (or something along those lines).

It would probably be useful to check all uses of QFile::encodeName() in that file now anyway, since that still looks wrong.  As far as I can tell, that result should never be assigned to a QString.  But I'm too disillusioned now to actually try building Amarok 2 to test it.
Comment 5 Lydia Pintscher 2008-08-07 10:40:27 UTC
Ok thank you Mook.
Subscribing Alejandro so he can have a look.