You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an older Samsung TV and it does not allow me to select UTF-8 as the subtitle encoding. It only has ISO-8859-X encodings to choose from.
Since Jellyfin always converts subtitle files to UTF-8, the decoding on the TV gets jumbled for special characters like 'é'. (See the images below)
After extensive testing, I have found that the TV does decode UTF-8 with BOM correctly.
It would be preferable if I were able to set the text encoding in the DLNA profile, but I do not have the expertise to tackle such a change. I have suggested it as a feature.
I was able to fix the issue by changing the subtitle encoding in:
// Create a UTF-8 encoding that supports a BOM.
Encoding utf8 = new UTF8Encoding(true);
byte[] utfBOM = [.. utf8.GetPreamble(), .. utf8.GetBytes(text)];
return new MemoryStream(utfBOM);
I have tested this change with the few DLNA devices I own and they all show subtitles as expected. (Including the old Samsung TV)
I would be happy to make a pull request if this fix is deemed appropriate.
Reproduction Steps
Play a video with an external subtitle file that includes special characters, on a device that does not support UTF-8. I used this srt to test..
Please describe your bug
I have an older Samsung TV and it does not allow me to select UTF-8 as the subtitle encoding. It only has ISO-8859-X encodings to choose from.
Since Jellyfin always converts subtitle files to UTF-8, the decoding on the TV gets jumbled for special characters like 'é'. (See the images below)
After extensive testing, I have found that the TV does decode UTF-8 with BOM correctly.
It would be preferable if I were able to set the text encoding in the DLNA profile, but I do not have the expertise to tackle such a change. I have suggested it as a feature.
I was able to fix the issue by changing the subtitle encoding in:
https://github.com/jellyfin/jellyfin/blob/31aa44d23d12b5dbb5f9a131242cc82c9ef98f24/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs#L186
to UTF-8 with BOM:
I have tested this change with the few DLNA devices I own and they all show subtitles as expected. (Including the old Samsung TV)
I would be happy to make a pull request if this fix is deemed appropriate.
Reproduction Steps
Play a video with an external subtitle file that includes special characters, on a device that does not support UTF-8.
I used this srt to test..
Jellyfin Version
10.9.0
if other:
10.9.6
Environment
Jellyfin logs
FFmpeg logs
No response
Please attach any browser or client logs here
No response
Please attach any screenshots here
UTF-8 error decoding:
UTF-8-BOM correct decoding:
Code of Conduct
The text was updated successfully, but these errors were encountered: