Bugzilla – Bug 15052
Album favorites with non-latin characters are broken
Last modified: 2010-04-08 17:26:16 UTC
Created attachment 6276 [details] Patch If you save an album with non-latin characters in the name as a favorite, the favorite cannot be played (message: not found). Example: Favorite (as shown in the edit text box in the web interface) reads as follows: db:album.titlesearch=COMPTINES%20%C3%80%20CHANTER%20VOLUME%201 %C3%80 is URI escaped version of UTF-8 code for the "à" character Fix: See patch below for Commands.pm which changes the unescaping of the string. uri_unescape returns an octet stream, which cannot be fed to Slim::Utils::Unicode::utf8decode (or the utf-8 character consisting of two octets will be interpreted as two characters). Rather Encode::decode_utf8 should be used, which interprets the octet stream correctly. --- Commands.pm 2009-11-05 00:21:42.000000000 +0100 +++ Commands.pm.new 2009-11-05 00:09:26.000000000 +0100 @@ -3248,7 +3248,7 @@ 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) ); $class = ucfirst($1); $obj = Slim::Schema->single( $class, { $key => $value } );
Andy: is this a dupe of bug 14930
*** Bug 14930 has been marked as a duplicate of this bug. ***
I think it should probably use utf8::decode rather than Encode.
(In reply to comment #3) > I think it should probably use utf8::decode rather than Encode. I have checked it out with utf8::decode. This also works perfectly fine. Why would you prefer utf8::decode over Encode::decode_utf8? The documentation of utf8::decode says "Note that this function does not handle arbitrary encodings. Therefore Encode is recommended for the general purposes;" I don't know whether arbitrary encodings could ever be an issue in our case.
In this case we already know the data in the database is UTF-8, we don't store any other encoding. Dealing with various other encodings is only an issue for the scanner.
Created attachment 6324 [details] Revised Patch for Bug 15052 (using utf8::decode)
Andy it seems like we have a bit of breathing room and the ability to fix a few more bugs. Would you like to go ahead and submit this? As always, I'd rather do it sooner than later so our beta users can check it out.
== Auto-comment from SVN commit #29729 to the slim repo by michael == == https://svn.slimdevices.com/slim?view=revision&revision=29729 == Fixed Bug: 15052 +0.5 Description: fix favorites encoding for albums - thanks Chris! Tested on OSX & Windows XP
This bug has been marked fixed in a released version of Squeezebox Server or the accompanying firmware or mysqueezebox.com release. If you are still seeing this issue, please let us know!