Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUETools: EAC log file encoding not always preserved #330

Closed
ffwema opened this issue Jun 4, 2024 · 6 comments · Fixed by #331
Closed

CUETools: EAC log file encoding not always preserved #330

ffwema opened this issue Jun 4, 2024 · 6 comments · Fixed by #331

Comments

@ffwema
Copy link

ffwema commented Jun 4, 2024

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:

  • for versions < 1: locale code page ("ANSI", Windows-1251, GB2312, ...)
  • for versions ≥ 1: UTF-16 LE BOM (logs containing checksums will fail verification with EAC's CheckLog.exe if their encoding is changed)
@c72578
Copy link
Collaborator

c72578 commented Jun 4, 2024

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
Copy link
Author

ffwema commented Jun 4, 2024

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
Copy link
Collaborator

c72578 commented Jun 4, 2024

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
Copy link
Author

ffwema commented Jun 4, 2024

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
Copy link
Collaborator

c72578 commented Jun 5, 2024

Yes, this will be fixed.

c72578 added a commit to c72578/cuetools.net that referenced this issue Jun 7, 2024
EAC log files are encoded using UTF-16LE since version 1.0 beta 1.
Since gchudov#51 (commit 9f80400) this encoding is preserved in case of EAC
log files, which contain a log checksum. However, only English log
files have been supported so far.

- Also preserve the encoding of EAC log files in different languages,
  if they contain a log checksum.
- Resolves gchudov#330
@c72578
Copy link
Collaborator

c72578 commented Jun 8, 2024

@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.

@c72578 c72578 closed this as completed in 4deaf3f Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants