From a717a531bc6c0b68dcd994a197e7bfd2fccb6538 Mon Sep 17 00:00:00 2001 From: Anthony Lavado Date: Thu, 23 Jul 2020 17:48:04 -0700 Subject: [PATCH] Merge pull request #3576 from HelloWorld017/fix/sami-utf16 Fix SAMI UTF-16 Encoding Bug (cherry picked from commit 0cb2cd94566c1228740f87075bdd4a9a00ccff90) Signed-off-by: Joshua M. Boniface --- MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs index a971115c9b..ab66e6ac31 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs @@ -426,7 +426,9 @@ namespace MediaBrowser.MediaEncoding.Subtitles // FFmpeg automatically convert character encoding when it is UTF-16 // If we specify character encoding, it rejects with "do not specify a character encoding" and "Unable to recode subtitle event" - if ((inputPath.EndsWith(".smi") || inputPath.EndsWith(".sami")) && (encodingParam == "UTF-16BE" || encodingParam == "UTF-16LE")) + if ((inputPath.EndsWith(".smi") || inputPath.EndsWith(".sami")) && + (encodingParam.Equals("UTF-16BE", StringComparison.OrdinalIgnoreCase) || + encodingParam.Equals("UTF-16LE", StringComparison.OrdinalIgnoreCase))) { encodingParam = ""; }