--- C:/Programme/SqueezeCenter/server/Slim/Plugin/MusicMagic/Importer.pm.sav Thu Dec 11 14:38:46 2008 +++ C:/Programme/SqueezeCenter/server/Slim/Plugin/MusicMagic/Importer.pm Sat Dec 13 18:11:08 2008 @@ -294,7 +294,15 @@ # Convert $track->url to a path and call MusicIP my $path = Slim::Utils::Misc::pathFromFileURL($trackurl); - my $pathEnc = Slim::Utils::Misc::escape($path); + # take care that MusicIP API will understand paths on Windows too + # TODO: someone please check if this breaks Linux or MacOS + my $pathEnc = Slim::Utils::Unicode::utf8on($path); + if ($isWin) { + $pathEnc = URI::Escape::uri_escape($pathEnc); + } else { + $pathEnc = Slim::Utils::Misc::escape($pathEnc); + } + $pathEnc = Slim::Utils::Unicode::utf8encode_locale($pathEnc); # Set musicmagic_mixable on $track object and call $track->update to actually store it. my $result = get("http://$MMSHost:$MMSport/api/status?song=$pathEnc"); @@ -493,6 +501,20 @@ return; } + # MIP returns playlist names as UTF-8 even on windows, so we need to convert + for my $playlist (@playlists) { + + if ($isWin) { + + $playlist = Slim::Utils::Unicode::utf8decode_guess( + $playlist, Slim::Utils::Unicode::encodingFromString($playlist), + ); + } + + # need conversion to the current charset. + $playlist = Slim::Utils::Unicode::utf8encode_locale($playlist); + } + # remove MIP playlists which don't exist any more foreach (Slim::Schema->search('Playlist', { url => {