Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-ASCII characters do not work in queries #27

Closed
theli-ua opened this issue Mar 20, 2015 · 3 comments
Closed

Non-ASCII characters do not work in queries #27

theli-ua opened this issue Mar 20, 2015 · 3 comments

Comments

@theli-ua
Copy link

Example of queries sent from Tomahawk for station with artists similar to "Turmion Kätilöt"
http://paste.ee/p/vGOcC

2:04 PM <•lfranchi> in which context?
2:05 PM <theli_ua> because of your "convert spaces to plus signs" (which actually is not relevant anymore, echonest works just fine with spaces) ... you convert part of query to percent encoding, then you pass that to addurlqueryparam, later qUrl does percent encoding again
2:06 PM <theli_ua> so, non ascii things gets percent encoded, later QUrl percent encodes that again, percent encoding percent signs

@theli-ua
Copy link
Author

Forgot to add - happens to me on Qt4, not sure if this is an issue with Qt5

@theli-ua
Copy link
Author

This is a hack I'm using to workaround that currently:

diff --git a/src/Playlist.cpp b/src/Playlist.cpp
index b5d992c..3317f4a 100644
--- a/src/Playlist.cpp
+++ b/src/Playlist.cpp
@@ -336,6 +336,7 @@ QNetworkReply* Echonest::DynamicPlaylist::generateInternal(const Echonest::Dynam
         }
     }

+    url.setUrl( QUrl::fromPercentEncoding(url.toString().toLatin1()));
     return Echonest::Config::instance()->nam()->get( QNetworkRequest( url ) );
 }

@theli-ua
Copy link
Author

This doesn't seem to be happening with Qt5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants