diff --git a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs index d02031fe6..f42e9c6ae 100644 --- a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs +++ b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs @@ -682,6 +682,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder throw new ApplicationException(msg); } + await SetAssFont(outputPath).ConfigureAwait(false); } /// @@ -843,6 +844,33 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder throw new ApplicationException(msg); } + + await SetAssFont(outputPath).ConfigureAwait(false); + } + + /// + /// Sets the ass font. + /// + /// The file. + /// Task. + private async Task SetAssFont(string file) + { + string text; + Encoding encoding; + + using (var reader = new StreamReader(file, detectEncodingFromByteOrderMarks: true)) + { + encoding = reader.CurrentEncoding; + + text = await reader.ReadToEndAsync().ConfigureAwait(false); + } + + text = text.Replace(",Arial,", ",Arial Unicode MS,"); + + using (var writer = new StreamWriter(file, false, encoding)) + { + writer.Write(text); + } } ///