Hello,
I'm saving a QList of songs into an XML. That goes well but the loading doesn't work out very well
When I save for example the song "Björk - It's Oh So Quiet.mp3" you get this in the XML file:
<song title="It's Oh So Quiet" path="C:\Documents and Settings\Gillis\Mijn documenten\Mijn muziek\Apart\Björk - It's Oh So Quiet.mp3" artist="Björk" album="It's Oh So Quiet" id="66" />.
When I try to load the path or the artist the 'ö' changes in a '?' or other things...
This is how I load the attributes:
{
int id = element.attribute("id").toInt();
Song* song = new Song(id);
song->path = element.attribute("path");
song->info.title = element.attribute("title");
song->info.artist = element.attribute("artist");
song->info.album = element.attribute("album");
currentPlaylist->append(song);
}
void parseSongElement(const QDomElement &element)
{
int id = element.attribute("id").toInt();
Song* song = new Song(id);
song->path = element.attribute("path");
song->info.title = element.attribute("title");
song->info.artist = element.attribute("artist");
song->info.album = element.attribute("album");
currentPlaylist->append(song);
}
To copy to clipboard, switch view to plain text mode
I have tried using element.attribute("path").toAscii() but that doesn't work either...
Thanks in advance,
Gillis
Bookmarks