# HG changeset patch # User yaz # Date 1155293090 25200 # Node ID e6fce20309f968da303a0560c53d95b9e4c6627b # Parent a8a2ee855c1c6a7b83d54e6ebc61cf6a4be60fc8 [svn] xspf.c needs round trip encoding conversion between locale encoding and utf8. diff -r a8a2ee855c1c -r e6fce20309f9 ChangeLog --- a/ChangeLog Fri Aug 11 01:48:51 2006 -0700 +++ b/ChangeLog Fri Aug 11 03:44:50 2006 -0700 @@ -1,3 +1,12 @@ +2006-08-11 08:48:51 +0000 William Pitcock + revision [2062] + - unbork + + + Changes: Modified: + +13 -1 trunk/Plugins/Container/xspf/xspf.c + + 2006-08-11 08:32:02 +0000 William Pitcock revision [2060] - remove unnecessary and crappy code diff -r a8a2ee855c1c -r e6fce20309f9 Plugins/Container/xspf/xspf.c --- a/Plugins/Container/xspf/xspf.c Fri Aug 11 01:48:51 2006 -0700 +++ b/Plugins/Container/xspf/xspf.c Fri Aug 11 03:44:50 2006 -0700 @@ -91,12 +91,18 @@ for (i = 0; i < n->nodeNr && n->nodeTab[i]->children != NULL; i++) { char *uri = XML_GET_CONTENT(n->nodeTab[i]->children); - + gchar *locale_uri = NULL; + if (uri == NULL) continue; ++pos; - playlist_ins(uri, pos); + locale_uri = g_locale_from_utf8(uri, -1, NULL, NULL, NULL); + if(locale_uri) { + playlist_ins(locale_uri, pos); + g_free(locale_uri); + locale_uri = NULL; + } g_free(uri); } @@ -131,11 +137,15 @@ { PlaylistEntry *entry = PLAYLIST_ENTRY(node->data); xmlNodePtr track, location; + gchar *utf_filename = NULL; track = xmlNewNode(NULL, "track"); location = xmlNewNode(NULL, "location"); - xmlAddChild(location, xmlNewText(entry->filename)); + utf_filename = g_locale_to_utf8(entry->filename, -1, NULL, NULL, NULL); + if(!utf_filename) + continue; + xmlAddChild(location, xmlNewText(utf_filename)); xmlAddChild(track, location); xmlAddChild(tracklist, track); @@ -163,6 +173,10 @@ xmlAddChild(track, tmp); } } + if(utf_filename) { + g_free(utf_filename); + utf_filename = NULL; + } } xmlSaveFile(filename, doc);