mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
[CUETools] Preserve EAC log file encoding
EAC log files are encoded using UTF-16LE. Preserve this encoding in case of EAC log files, which contain a log checksum. This way, the copied log file stays unchanged and the checksum can still be verified using EAC's CheckLog.exe
This commit is contained in:
@@ -2310,6 +2310,9 @@ namespace CUETools.Processor
|
||||
{
|
||||
bool utf8Required = CUESheet.Encoding.GetString(CUESheet.Encoding.GetBytes(text)) != text;
|
||||
var encoding = utf8Required ? Encoding.UTF8 : 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"))
|
||||
encoding = Encoding.Unicode;
|
||||
using (StreamWriter sw1 = new StreamWriter(path, false, encoding))
|
||||
sw1.Write(text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user