Bugzilla – Bug 9878
Favorites with non-latin characters in their url don't work
Last modified: 2009-10-21 09:45:56 UTC
An album by Herbert Grönemeyer: Titel: Zwölf URL: db:album.titlesearch=ZW%C3%96LF Wouldn't work. We'd probably have to save the titlesort string in these cases.
non-latin characters seem to be double-encoded: [08-11-05 14:22:21.3592] Slim::Player::Song::new (76) Error: Could not find handler for db:contributor.namesearch=ALI%20FARKA%20TOUR%C3%83%C2%89! [08-11-05 14:22:21.3600] Slim::Control::Request::execute (1887) Error: While trying to run function coderef [Slim::Control::Commands::playlistJumpCommand]: [Can't call method "blessed" without a package or object reference at /Users/mh/Documents/workspace/7.3/server/Slim/Player/StreamingController.pm line 644. ] [08-11-05 14:22:40.6425] Slim::Player::Song::new (76) Error: Could not find handler for db:album.titlesearch=F%C3%83%C2%9CR%20USSZEGSCHNIGGE! [08-11-05 14:22:40.6431] Slim::Control::Request::execute (1887) Error: While trying to run function coderef [Slim::Control::Commands::playlistJumpCommand]: [Can't call method "blessed" without a package or object reference at /Users/mh/Documents/workspace/7.3/server/Slim/Player/StreamingController.pm line 644. ]
Alan - do you have an idea what's wrong with the db: url handler? [08-11-05 14:22:21.3592] Slim::Player::Song::new (76) Error: Could not find handler for db:contributor.namesearch=ALI%20FARKA%20TOUR%C3%83%C2%89! [08-11-05 14:22:21.3600] Slim::Control::Request::execute (1887) Error: While trying to run function coderef [Slim::Control::Commands::playlistJumpCommand]: [Can't call method "blessed" without a package or object reference at /Users/mh/Documents/workspace/7.3/server/Slim/Player/StreamingController.pm line 644. ] [08-11-05 14:22:40.6425] Slim::Player::Song::new (76) Error: Could not find handler for db:album.titlesearch=F%C3%83%C2%9CR%20USSZEGSCHNIGGE! [08-11-05 14:22:40.6431] Slim::Control::Request::execute (1887) Error: While trying to run function coderef [Slim::Control::Commands::playlistJumpCommand]: [Can't call method "blessed" without a package or object reference at /Users/mh/Documents/workspace/7.3/server/Slim/Player/StreamingController.pm line 644. ]
Not sure whether this is the same bug: I have albums with utf8 characters in the file name (url). When such an album is saved as favorite, playing the favorite does not work. E.g. URL="db:album.titlesearch=COMPTINES%20%C3%80%20CHANTER%20VOLUME%202" When the favorite is played, the player shows "Now Playing: Nothing" (empty playlist). No errors in "server.log". (SqueezeCenter 7.2.1 on Ubuntu Feisty)
(In reply to comment #3) > Not sure whether this is the same bug: I have albums with utf8 characters in > the file name (url). When such an album is saved as favorite, playing the > favorite does not work. E.g. > > URL="db:album.titlesearch=COMPTINES%20%C3%80%20CHANTER%20VOLUME%202" > > When the favorite is played, the player shows "Now Playing: Nothing" (empty > playlist). No errors in "server.log". > > (SqueezeCenter 7.2.1 on Ubuntu Feisty) > Just upgraded to 7.2.2 and the problem persists.
(In reply to comment #4) > (In reply to comment #3) > > Not sure whether this is the same bug: I have albums with utf8 characters in > > the file name (url). When such an album is saved as favorite, playing the > > favorite does not work. E.g. > > > > URL="db:album.titlesearch=COMPTINES%20%C3%80%20CHANTER%20VOLUME%202" > > > > When the favorite is played, the player shows "Now Playing: Nothing" (empty > > playlist). No errors in "server.log". > > > > (SqueezeCenter 7.2.1 on Ubuntu Feisty) > > > > Just upgraded to 7.2.2 and the problem persists. > There seem to be two issues, for which I include suggested patches: - An album/genre/contributor with latin characters, if saved as a favorite, is utf8-encoded twice before being uri-encoded. Thus, the resulting URL contains garbage --> see suggested patches for Schema/Album.pm, Schema/Genre.pm and Schema/Contributor.pm attached. - A favorite with URI-encoded UTF-8-encoded latin characters is needs to be not only URI-decoded, but also UTF-8-decoded --> see suggested patch for Control/Commands.pm attached.
Created attachment 4519 [details] Patches for Bug 9878
Thanks Chris. Do you have an idea why you need to utf8decode in one case, but not the others? I'll take another look at this issue in the new year. But I fear your patch will not work on all platforms (first of all not on Windows). It'll need some more work.
Chris - do you still see this issue with the latest 7.3.x revisions? And could you please give me some details about your system (as found in Settings/Information)?
Chris?
although i'm not Chris... i've checked out the latest 7.3r24680 and created two favorites, one "artist" and one "album", each containing an umlaut. favorites.opml looks like: <?xml version="1.0" encoding="UTF-8"?> <opml version="1.0"> <head title="Favorites"> <expansionState></expansionState> </head> <body> <outline URL="db:contributor.namesearch=ALIZ%C3%83%C2%89E" icon="html/images/artists.png" text="Alizée" type="audio" /> <outline URL="db:album.titlesearch=%C3%83%C2%87A%20IRA" icon="html/images/albums.png" text="Ça Ira" type="audio" /> </body> </opml> Both entries are displayed by SC. Trying to playback those results in errors logged to server.log: [09-01-16 13:59:45.3989] Slim::Player::Song::new (76) Error: Could not find handler for db:contributor.namesearch=ALIZ%C3%83%C2%89E! [09-01-16 13:59:53.7025] Slim::Player::Song::new (76) Error: Could not find handler for db:album.titlesearch=%C3%83%C2%87A%20IRA! system: Version: 7.3.3 - TRUNK @ UNKNOWN Hostname: vserver1 Server IP Address: <IP> Server HTTP Port Number: 9000 Operating system: Linux - EN - utf8 Platform Architecture: x86_64-linux Perl Version: 5.8.8 - x86_64-linux-thread-multi MySQL Version: 5.0.70-log Total Players Recognized: 5 btw. Chris' patch works here...those two lines in favorites.opml are now stored as: <outline URL="db:contributor.namesearch=ALIZ%C3%89E" icon="html/images/artists.png" text="Alizée" type="audio" /> <outline URL="db:album.titlesearch=%C3%87A%20IRA" icon="music/4604/cover.png" text="Ça Ira" type="audio" />
change 24729 - Thanks for the patch - seems to be working fine on Windows too. use uri_encode instead of uri_encode_utf8 to store URLs
works fine - once more: thanks!
This bug has been fixed in the 7.3.3 release version of SqueezeCenter! If you haven't already. please download the new version from http://www.logitechsqueezebox.com/support/download-squeezecenter.html If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
(In reply to comment #13) > This bug has been fixed in the 7.3.3 release version of SqueezeCenter! > > If you haven't already. please download the new version from > http://www.logitechsqueezebox.com/support/download-squeezecenter.html > > If you are still experiencing this problem, feel free to reopen the bug with > your new comments and we'll have another look. Whoever incorporated my patch into the 7.3 tree has changed my patch for Commands.pm from Encode::decode_utf8 to Slims::Utils::Unicode::utf8decode But this gives wrong results (at least for me). URI::Escape::uri_unescape returns an octet stream, not a string. Thus, it cannot be fed to utf8decode, but the octet streams must be converted into utf8 by using Encode::decode_utf8. See patch below: --------------------------------------------------------- --- Commands.pm.orig 2009-06-16 00:12:38.000000000 +0200 +++ Commands.pm 2009-08-11 01:33:07.000000000 +0200 @@ -3124,8 +3124,8 @@ if ($term =~ /^(\w+)\.(\w+)=(.*)$/) { my $key = URI::Escape::uri_unescape($2); - my $value = Slim::Utils::Unicode::utf8decode( URI::Escape::uri_unescape($3) ); - + my $value = Encode::decode_utf8(URI::Escape::uri_unescape($3)); +# And not Slim::Utils::Unicode::utf8decode as URI::Escape::uri_unescape returns an octet stream, not a string !!! $class = ucfirst($1); $obj = Slim::Schema->single( $class, { $key => $value } );
Created attachment 5594 [details] Patch for Bug 9878 (reopened) See my earlier comment
Michael: Can you comment on this?
Chris - is this patch against 7.4? And what platforms did you test it with?
(In reply to comment #17) > Chris - is this patch against 7.4? And what platforms did you test it with? It is against 7.3.3, where I have tested it, but should work also against 7.4, as the relevant part of Commands.pm was not changed in 7.4. It was actually already suggested in my original patch (Comment 6). When the original patch was incorporated into the 7.3.3 release, someone changed Encode::decode_utf8 to Slims::Utils::Unicode::utf8decode But as explained, that seems wrong. Best regards, Chris
Chris - this is working fine for me from the web UI anc Controller: I've added artist "Ang�lique Kidjo" and album "F�r usszeschnigge" to my favorites, and they play fine. It does fail from the player UI. Can you confirm this?
QA - could you please try to reproduce with 7.4.1? Please note: album/artist favorites are indeed broken. But that's a different issue. Only test with single tracks.
Tested with 7.4.1 r28825, appears to be working for me now.
Verified fixed in 7.4.1 r28825
(In reply to comment #22) > Verified fixed in 7.4.1 r28825 Michael mentioned that album/artist favorites are still broken (which is also my perception) - so is this a different bug? I still think that in Commands.pm, line 3251, URI::Escape::uri_unescape returns an octet stream, not a string. Thus, it cannot be fed to utf8decode, but the octet streams must be converted into utf8 by using Encode::decode_utf8 For me my suggest change to this line made album/artist favorites work. Can you please verify! Regards, Chris