diff --git a/CUETools.Processor/CUESheet.cs b/CUETools.Processor/CUESheet.cs index c408f9c5..f5fa2946 100644 --- a/CUETools.Processor/CUESheet.cs +++ b/CUETools.Processor/CUESheet.cs @@ -2389,7 +2389,7 @@ public static void WriteText(CUEConfig _config, string path, string text) bool utf8Required = (_config.alwaysWriteUTF8CUEFile && Path.GetExtension(path) == ".cue") || (CUESheet.Encoding.GetString(CUESheet.Encoding.GetBytes(text)) != text); var encoding = utf8Required ? new UTF8Encoding(_config.writeUTF8BOM) : CUESheet.Encoding; // Preserve original UTF-16LE encoding of EAC log files, which contain a log checksum - if ((text.StartsWith("Exact Audio Copy") || text.StartsWith("EAC extraction logfile")) && text.Contains("==== Log checksum")) + if (Path.GetExtension(path) == ".log" && text.StartsWith("Exact Audio Copy") && (text.EndsWith(" ====\r\n") || text.EndsWith(" ====\n"))) encoding = Encoding.Unicode; using (StreamWriter sw1 = new StreamWriter(path, false, encoding)) sw1.Write(text);