Bug 3245 - Accented characters and artwork filenames
: Accented characters and artwork filenames
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Web Interface
: 6.5b1
: PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-05 09:06 UTC by sbjaerum
Modified: 2008-09-15 14:39 UTC (History)
0 users

See Also:
Category: ---


Attachments
Artwork filename encoding patch (390 bytes, patch)
2006-04-17 02:16 UTC, sbjaerum
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sbjaerum 2006-04-05 09:06:03 UTC
I am running 6.5 on Windows XP - EN - cp1252 and have problems getting artwork to display when artist or album contains an accented character.

In slimserver.pref I have:
coverArt: '%ARTIST-ALBUM'
coverThumb: '%ARTIST-ALBUM-thumb'

For debugging this, my music directory only contains the following files:
Ry Cooder-Ch�vez Ravine-thumb.jpg
Ry Cooder-Ch�vez Ravine.jpg
Ry_Cooder-Chavez_Ravine-2005.flac
The flac file contains the whole album audio data and has embedded cuesheet and tag information.
Pay attention to the accented � in the jpg file names. The reason for this accented character is to match the artwork filename to the %ARTIST-ALBUM tags.

When I clear the cache and start slimserver with --d_artwork enabled, I get the following result:
C:\slim\trunk\server>slimserver.pl --d_artwork
2006-04-01 12:16:39.3281 Retrieving artwork (thumb) for: file:///E:/audio/debug/Ry_Cooder-Chavez_Ravine-2005.flac
2006-04-01 12:16:39.3296 readCoverArtTags: Looking for a covert art image in the tags of: [E:\audio\debug\Ry_Cooder-Chavez_Ravine-2005.flac]
2006-04-01 12:16:39.3317 Looking for image files in E:\audio\debug
2006-04-01 12:16:39.3590 Variable Thumbnail: Ry Cooder-Ch+�vez Ravine-thumb.jpg from ARTIST-ALBUM-thumb
2006-04-01 12:16:39.3944 getImageContent: Image File empty or couldn't read: E:\audio\debug\Ry Cooder-Ch+�vez Ravine-thumb.jpg : No such file or directory
2006-04-01 12:16:39.3965 getImageContent: Image File empty or couldn't read: \Ry Cooder-Ch+�vez Ravine-thumb.jpg : No such file or directory
2006-04-01 12:16:39.4078 Completed Artwork Scan

My interpretation of this is that the tags are encoded with utf8, which result in wrong file name when accessing the file system.
Somehow the internal encoding must be translated to the encoding that XP uses when trying to open the file.

I want my tags to display accented characters, and because the jpg filenames are exctracted from the tags, I don't see how the accents in the filenames can be avoided.
Comment 1 Barry Klawans 2006-04-08 21:34:00 UTC
Check how the characters are encoded on the filename of the image file.  I'm not sure the right way on Windows, but on *nix you can do "ls -b" shows you the actual byte encoding.

One issue I've run into is how Perl handles UTF-8 encoded strings.  Unfortunately there are two ways to encode the character "a acute" which is what you have.  There is a straight encoding (UTF-8 C3 A1) and there is the alternate encoding of "small a + acute accent" which is 61 CC 81.  (The 61 is the 'a' and the rest is a combining-diacritic which is a fancy way of saying "add to the previous character")  It looks to me like Perl in some cases converts the later to the former, so the actual path is then wrong.

I know it can work - I have some old Blue �yster Cult albums and the artwork files have the umlaut in the file name, and all work.
Comment 2 sbjaerum 2006-04-17 02:16:56 UTC
Created attachment 1187 [details]
Artwork filename encoding patch

The attached patch below fixes the problem.

I am not sure if the fix should be placed where I have put it, and a proper patch needs to include test for Windows OS in order to not mess things up for other OS'es etc. But at least the diff shows the concept of what has to be done...
Comment 3 Dan Sully 2006-04-22 15:12:56 UTC
Thanks. Commited as  change 7055