Bug 333946 - Podcast save location containing Korean characters are garbled
Summary: Podcast save location containing Korean characters are garbled
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Podcast (show other bugs)
Version: 2.8.0
Platform: Kubuntu Linux
: NOR normal (vote)
Target Milestone: 2.9
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-27 08:01 UTC by Shinjo Park
Modified: 2015-01-22 00:44 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shinjo Park 2014-04-27 08:01:15 UTC
When specifying podcast save location with Korean characters in path, it is garbled after restarting Amarok. Amarok repeatly creates meaningless folders on the disk, so I need to modify path not to contain any Korean characters. This is problematic since "Music" folder is localized into "음악" by default when system locale is set to Korean.

Reproducible: Always

Steps to Reproduce:
1. Specify podcast save location containing Korean. Example: "/home_hdd/psj/음악/podcasts/"
2. Restart Amarok.
3. Check back save location of same podcast.
Actual Results:  
Save location is changed into "/home_hdd/psj/�일 4월 27 2014DC악/podcasts/"

Expected Results:  
It should stay same "/home_hdd/psj/음악/podcasts/"
Comment 1 Eike Hein 2015-01-15 19:34:41 UTC
Does this still happen on current versions of Amarok?
Comment 2 Myriam Schweingruber 2015-01-15 21:40:14 UTC
(In reply to Eike Hein from comment #1)
> Does this still happen on current versions of Amarok?

Well, the current released version is 2.8, you will have to test with current git to see if there is a change.
Comment 3 Shinjo Park 2015-01-16 05:50:04 UTC
(In reply to Myriam Schweingruber from comment #2)
> (In reply to Eike Hein from comment #1)
> > Does this still happen on current versions of Amarok?
> 
> Well, the current released version is 2.8, you will have to test with
> current git to see if there is a change.

I tested using both today's git and Ubuntu 14.10 package (2.8.0-0ubuntu4), and the bug is still there. My test steps were the same as original description, for further tests I've added an example podcast address:

1) Add some podcast with Korean title (for example: http://www.xsfm.co.kr/xml/idwk.xml)
2) Check out save location just after adding the podcast (Should be: $HOME/.kde/share/apps/amarok/podcasts/그것은 알기 싫다)
3) Restart Amarok, re-check the save location (Broken: $HOME/.kde/share/apps/amarok/podcasts/그것�금 1월 16 2015D� ��C기�B��B�)
Comment 4 Eike Hein 2015-01-16 12:34:17 UTC
^ Thank you -- I'll try to reproduce this within the next days and fix it.
Comment 5 Eike Hein 2015-01-16 19:17:05 UTC
Yep, can reproduce it.
Comment 6 Eike Hein 2015-01-16 20:32:18 UTC
I've figured out what happens: KUrl turns the Korean characters in the save location into percent-encoding, which results in '%<number>' embeds in the URL string which later cause trouble when a SQL query builder uses QString::arg() to insert the URL and other data into a query template. I'll port the query builder away from arg() to fix this.
Comment 7 Eike Hein 2015-01-16 21:11:32 UTC
Git commit 0e069fcdc1bd7fe3052c9bdba624e11a2d9d6a75 by Eike Hein.
Committed on 16/01/2015 at 21:07.
Pushed by hein into branch 'master'.

Port the SqlPodcastChannel query builder from QString::arg() to QTextStream.

Among the query payload is a local filesystem URL, which may
contain percent-encoded non-ASCII data, e.g. a directory name
written in Korean. This causes havoc in combiation with the
percent sign-based placeholders QString::arg() operates on.

The SqlPodcastEpisode query builder was already using
QTextStream.

M  +63   -29   src/core-impl/podcasts/sql/SqlPodcastMeta.cpp

http://commits.kde.org/amarok/0e069fcdc1bd7fe3052c9bdba624e11a2d9d6a75