LMS-Community / slimserver

Server for Squeezebox and compatible players. This server is also called Lyrion Music Server.
https://lyrion.org
Other
1.2k stars 298 forks source link

DISCSUBTITLE presented as Latin-1 rather than UTF-8 with international characters #1220

Open koldinger opened 3 hours ago

koldinger commented 3 hours ago

This is a 9.0 issue, haven't tried on 8.5 yet.

When using the material skin (the only one which, as far as I know, uses the Disc Subtitle feature), disc subtitles show up incorrectly. I have a disc in a collection which has the subtitle "Debussy: Images, Prélude à l'après-midi d'un faune". This data is stored correctly in the tracks.db database as UTF-8 characters, however, in the skin, it is being presented in Latin1 (iec 8859-1), namely "Debussy: Images, Prélude à l'après-midi d'un faune". The track title, which should be the exact same bytes, does get presented correctly.

Also, in the "Show Tags" screen, it is showing up correctly.

I filed this as Material Skin bug, but @CDrummond thinks it's an LMS issue. https://github.com/CDrummond/lms-material/issues/981.
@CDrummond noticed the fact that it shows up in show tags correctly.

LMS: Version: 9.0.0 - 1731600535 @ Fri Nov 15 02:59:48 UTC 2024

Garbled image

michaelherger commented 2 hours ago

@darrell-k - some missing utf8::decode() somewhere?

michaelherger commented 2 hours ago

Maybe this?

diff --git a/Slim/Control/Queries.pm b/Slim/Control/Queries.pm
index 5e2e09536..c48b95672 100644
--- a/Slim/Control/Queries.pm
+++ b/Slim/Control/Queries.pm
@@ -6351,6 +6351,7 @@ sub _getTagDataForTracks {
                        utf8::decode( $c->{'contributors.name'} ) if exists $c->{'contributors.name'};
                        utf8::decode( $c->{'genres.name'} ) if exists $c->{'genres.name'};
                        utf8::decode( $c->{'comments.value'} ) if exists $c->{'comments.value'};
+                       utf8::decode( $c->{'tracks.discsubtitle'}) if exists $c->{'tracks.discsubtitle'};
                }

                my $id = $c->{'tracks.id'};
darrell-k commented 2 hours ago

Ah yes. You've done it already?

michaelherger commented 22 minutes ago

I'm sorry, no. Haven't had the opportunity yet to test this.

darrell-k commented 9 minutes ago

I'll test and add to the PR I just submitted.