diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs index e09f479..17db578 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs @@ -370,7 +370,7 @@ namespace N_m3u8DL_RE.DownloadManager subContentFixed = OtherUtil.WebVtt2Other(finalVtt, DownloaderConfig.MyOptions.SubtitleFormat); output = Path.ChangeExtension(output, ".srt"); } - await File.WriteAllTextAsync(path, subContentFixed, new UTF8Encoding(false)); + await File.WriteAllTextAsync(path, subContentFixed, Encoding.UTF8); FileDic[keys.First()] = new DownloadResult() { ActualContentLength = subContentFixed.Length, @@ -405,7 +405,7 @@ namespace N_m3u8DL_RE.DownloadManager subContentFixed = OtherUtil.WebVtt2Other(finalVtt, DownloaderConfig.MyOptions.SubtitleFormat); output = Path.ChangeExtension(output, ".srt"); } - await File.WriteAllTextAsync(path, subContentFixed, new UTF8Encoding(false)); + await File.WriteAllTextAsync(path, subContentFixed, Encoding.UTF8); FileDic[firstKey] = new DownloadResult() { ActualContentLength = subContentFixed.Length, @@ -438,7 +438,7 @@ namespace N_m3u8DL_RE.DownloadManager subContentFixed = OtherUtil.WebVtt2Other(finalVtt, DownloaderConfig.MyOptions.SubtitleFormat); output = Path.ChangeExtension(output, ".srt"); } - await File.WriteAllTextAsync(path, subContentFixed, new UTF8Encoding(false)); + await File.WriteAllTextAsync(path, subContentFixed, Encoding.UTF8); FileDic[firstKey] = new DownloadResult() { ActualContentLength = subContentFixed.Length, @@ -475,7 +475,7 @@ namespace N_m3u8DL_RE.DownloadManager subContentFixed = OtherUtil.WebVtt2Other(finalVtt, DownloaderConfig.MyOptions.SubtitleFormat); output = Path.ChangeExtension(output, ".srt"); } - await File.WriteAllTextAsync(path, subContentFixed, new UTF8Encoding(false)); + await File.WriteAllTextAsync(path, subContentFixed, Encoding.UTF8); FileDic[firstKey] = new DownloadResult() { ActualContentLength = subContentFixed.Length, diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs index ee4ba38..26a44d7 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs @@ -313,7 +313,7 @@ namespace N_m3u8DL_RE.DownloadManager FileDic.Clear(); var path = Path.Combine(tmpDir, Path.GetFileNameWithoutExtension(files.Last()) + ".vtt"); var subContentFixed = finalVtt.ToString(); - await File.WriteAllTextAsync(path, subContentFixed, new UTF8Encoding(false)); + await File.WriteAllTextAsync(path, subContentFixed, Encoding.UTF8); FileDic[keys.First()] = new DownloadResult() { ActualContentLength = subContentFixed.Length, @@ -339,7 +339,7 @@ namespace N_m3u8DL_RE.DownloadManager FileDic.Clear(); var path = Path.Combine(tmpDir, Path.GetFileNameWithoutExtension(mp4s.Last()) + ".vtt"); var subContentFixed = finalVtt.ToString(); - await File.WriteAllTextAsync(path, subContentFixed, new UTF8Encoding(false)); + await File.WriteAllTextAsync(path, subContentFixed, Encoding.UTF8); FileDic[firstKey] = new DownloadResult() { ActualContentLength = subContentFixed.Length, @@ -361,7 +361,7 @@ namespace N_m3u8DL_RE.DownloadManager FileDic.Clear(); var path = Path.Combine(tmpDir, Path.GetFileNameWithoutExtension(mp4s.Last()) + ".vtt"); var subContentFixed = finalVtt.ToString(); - await File.WriteAllTextAsync(path, subContentFixed, new UTF8Encoding(false)); + await File.WriteAllTextAsync(path, subContentFixed, Encoding.UTF8); FileDic[firstKey] = new DownloadResult() { ActualContentLength = subContentFixed.Length, @@ -387,7 +387,7 @@ namespace N_m3u8DL_RE.DownloadManager FileDic.Clear(); var path = Path.Combine(tmpDir, Path.GetFileNameWithoutExtension(mp4s.Last()) + ".vtt"); var subContentFixed = finalVtt.ToString(); - await File.WriteAllTextAsync(path, subContentFixed, new UTF8Encoding(false)); + await File.WriteAllTextAsync(path, subContentFixed, Encoding.UTF8); FileDic[firstKey] = new DownloadResult() { ActualContentLength = subContentFixed.Length,