gchudov / cuetools.net

CD image processing suite with optimized lossless encoders in C#
http://cue.tools/
Other
480 stars 51 forks source link

CUETools: EAC log file encoding not always preserved #330

Closed ffwema closed 3 months ago

ffwema commented 3 months ago

A tiny bug: when encoding with CUETools, the EAC log encoding is not always preserved (the problem was partially solved in version 2.1.8). This example log file (apologies for the .txt extension but for some reason the GitHub does not allow me to upload files with .log extension) is UTF-16 LE BOM encoded, however the CUETools converts it to UTF-8-BOM. EAC encodes logs as:

c72578 commented 3 months ago

The UTF-16LE encoding of EAC log files is only preserved, if they contain a log checksum (#51). However, the attached example log file does not contain a log checksum.

ffwema commented 3 months ago

Sorry, forgot to check #51 before posting. Do you perhaps know the reason for changing the encoding of (checksum-less) log files? I know it's not terribly important, but I've just always preferred to keep my logs "unaltered". Anyway, I can reproduce the issue with example log file with checksum.

c72578 commented 3 months ago

Thanks for the additional info and posting the example log file, which contains localized ==== Log checksum. This needs to be fixed...

Do you perhaps know the reason for changing the encoding of (checksum-less) log files?

The original request primarily concerned log files with checksum.

ffwema commented 3 months ago

Well, if you decide to preserve the encoding only for logs with checksums, this would probably work as a quick temporary fix:

// Preserve original UTF-16LE encoding of EAC log files, which contain a log checksum
if (text.StartsWith("Exact Audio Copy") && text.EndsWith(" ===="))
c72578 commented 3 months ago

Yes, this will be fixed.

c72578 commented 3 months ago

@ffwema A build with a fix has been prepared in #331, which also preserves the encoding of localized EAC logfiles, which contain a log checksum, like in example log file with checksum.