Index: Slim/Formats/FLAC.pm =================================================================== RCS file: /cvsroot/slim/server/Slim/Formats/FLAC.pm,v retrieving revision 1.9 diff -u -r1.9 FLAC.pm --- Slim/Formats/FLAC.pm 26 Jan 2004 05:44:13 -0000 1.9 +++ Slim/Formats/FLAC.pm 12 Jun 2004 18:26:04 -0000 @@ -18,6 +18,7 @@ use strict; use Audio::FLAC; use MP3::Info (); +use Encode; my %tagMapping = ( 'TRACKNUMBER' => 'TRACKNUM', @@ -25,6 +26,18 @@ 'DISCNUMBER' => 'DISC', ); +my @tagNames = ( + 'ALBUM', + 'ARTIST', + 'BAND', + 'COMPOSER', + 'CONDUCTOR', + 'DISCNUMBER', + 'TITLE', + 'TRACKNUMBER', + 'DATE', +); + # Given a file, return a hash of name value pairs, # where each name is a tag name. sub getTag { @@ -42,6 +55,14 @@ # There should be a TITLE tag if the VORBIS tags are to be trusted if (defined $tags->{'TITLE'}) { + + # Convert the tag values to from utf8 to latin1 + foreach my $tag (@tagNames) { + if (exists $tags->{$tag}) { + my $utf8tag = Encode::decode("utf8", $tags->{$tag}, Encode::FB_PERLQQ); + $tags->{$tag} = Encode::encode("latin1", $utf8tag, Encode::FB_PERLQQ); + } + } # map the existing tag names to the expected tag names while (my ($old,$new) = each %tagMapping) {