# HG changeset patch # User yaz # Date 1155438008 25200 # Node ID d60e3dbe1a48370a645012554221e2f64049ae3f # Parent 063fde7e5100467316f79f2e2255917c1b4ba265 [svn] - better handling for file name which can't be represented correctly in current locale encoding. diff -r 063fde7e5100 -r d60e3dbe1a48 ChangeLog --- a/ChangeLog Sat Aug 12 16:46:09 2006 -0700 +++ b/ChangeLog Sat Aug 12 20:00:08 2006 -0700 @@ -1,3 +1,12 @@ +2006-08-12 23:46:09 +0000 George Averill + revision [2071] + - Show the filename if there's no track_name + + + Changes: Modified: + +12 -6 trunk/Plugins/General/notify/notify.c + + 2006-08-12 01:41:53 +0000 William Pitcock revision [2068] - installing Container plugins might help! diff -r 063fde7e5100 -r d60e3dbe1a48 Plugins/Container/xspf/xspf.c --- a/Plugins/Container/xspf/xspf.c Sat Aug 12 16:46:09 2006 -0700 +++ b/Plugins/Container/xspf/xspf.c Sat Aug 12 20:00:08 2006 -0700 @@ -98,6 +98,10 @@ ++pos; locale_uri = g_locale_from_utf8(uri, -1, NULL, NULL, NULL); + if(!locale_uri){ + /* try ISO-8859-1 for last resort */ + locale_uri = g_convert(uri, -1, "ISO-8859-1", "UTF-8", NULL, NULL, NULL); + } if(locale_uri) { playlist_ins(locale_uri, pos); g_free(locale_uri); @@ -142,9 +146,12 @@ track = xmlNewNode(NULL, "track"); location = xmlNewNode(NULL, "location"); - utf_filename = g_locale_to_utf8(entry->filename, -1, NULL, NULL, NULL); - if(!utf_filename) - continue; + /* try locale encoding first */ + utf_filename = g_locale_to_utf8(entry->filename, -1, NULL, NULL, NULL); + if (!utf_filename) { + /* if above fails, try to guess */ + utf_filename = str_to_utf8(entry->filename); + } xmlAddChild(location, xmlNewText(utf_filename)); xmlAddChild(track, location); xmlAddChild(tracklist, track);