Bug 4281 - Mix do not work with accented characters in filenames and paths
: Mix do not work with accented characters in filenames and paths
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: MusicIP
: 6.5.0
: PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-03 10:47 UTC by Pierre
Modified: 2008-12-18 11:11 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre 2006-10-03 10:47:56 UTC
If I select a song on softsqueeze with accented characters in filename and hold the play button (to launch a MusicMagic Mix), the song title appearing in the mix gets garbled. Also, a duplicated song is created in the database. When browsing the album with the Web server, I have one entry displaying the correct title pointing to the correct filename, and one entry with a garbled title pointing to a garbled filename. Here is an example.

6. Y Tú Qué Has Hecho de Buena Vista Social Club par Buena Vista Social Club 
6. �Y T� Qu� Has Hecho? de Buena Vista Social Club par Buena Vista Social Club

I am proposing the following fix in Plugins.pm. Change:

for (my $j = 0; $j < $count; $j++) {

   my $newPath = Plugins::MusicMagic::Common::convertPath($songs[$j]);
   $::d_musicmagic && msg("MusicMagic: Original $songs[$j] : New $newPath\n");
   push @mix, Slim::Utils::Misc::fileURLFromPath($newPath);
}

for:

for (my $j = 0; $j < $count; $j++) {

   my $enc = Slim::Utils::Unicode::encodingFromString($songs[$j]);
   $songs[$j] = Slim::Utils::Unicode::utf8decode_guess($songs[$j], $enc);

   my $newPath = Plugins::MusicMagic::Common::convertPath($songs[$j]);
   $::d_musicmagic && msg("MusicMagic: Original $songs[$j] : New $newPath\n");
   push @mix, Slim::Utils::Misc::fileURLFromPath($newPath);
}

The two lines I added are basically replicating the fix to bug 3318 that was implemented in Importers.pm when importing data from MusicIP, only here it is applied to mix generation.
Comment 1 Chris Owens 2006-10-03 11:52:13 UTC
I didn't target this because I don't know how risky a change it is to put in days before the 6.5.1 release.
Comment 2 Dan Sully 2006-10-03 14:47:57 UTC
fixed in change 10161

Thanks for the patch.