diff --git a/src/playlistparsers/xspfparser.cpp b/src/playlistparsers/xspfparser.cpp index f69a681de..6a596de04 100644 --- a/src/playlistparsers/xspfparser.cpp +++ b/src/playlistparsers/xspfparser.cpp @@ -75,7 +75,7 @@ Song XSPFParser::ParseTrack(QXmlStreamReader *reader, const QDir &dir, const boo switch (type) { case QXmlStreamReader::StartElement: { if (name == "location") { - location = reader->readElementText(); + location = QUrl::fromPercentEncoding(reader->readElementText().toUtf8()); } else if (name == "title") { title = reader->readElementText(); @@ -154,7 +154,7 @@ void XSPFParser::Save(const SongList &songs, QIODevice *device, const QDir &dir, StreamElement tracklist("trackList", &writer); for (const Song &song : songs) { - QString filename_or_url = URLOrFilename(song.url(), dir, path_type).toUtf8(); + QString filename_or_url = QUrl::toPercentEncoding(URLOrFilename(song.url(), dir, path_type), "/ "); StreamElement track("track", &writer); writer.writeTextElement("location", filename_or_url);