gchudov / cuetools.net

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

CUETools: "Correct filenames" action "mangles" special characters in cuesheets #326

Closed ffwema closed 3 months ago

ffwema commented 3 months ago

The Correct filenames action in CUETools "mangles" special characters in cuesheets, for example é becomes Ă©. Tested with original cuesheet encoded in UTF-8 -> processed cuesheet is encoded in UTF-8 BOM (option Always write UTF-8 CUE sheet checked). This does not happen when using the Encode action.

c72578 commented 3 months ago

@ffwema thanks for the report. However, the issue could not be reproduced yet. I did some tests using é in a filename.

In UTF-8, é is supposed to be encoded as 0xC3 0xA9

c72578 commented 3 months ago

@ffwema thanks for the report. The issue could be reproduced. As you mentioned, this happens, when the original cuesheet is encoded in UTF-8 (without BOM). If the original cuesheet is ANSI or UTF-8-BOM encoded, it is working properly.

c72578 commented 3 months ago

The origin of the issue is here: https://github.com/gchudov/cuetools.net/blob/f52b795a1ab336c49ac183d7dabe5f0305555059/CUETools/frmCUETools.cs#L817

A fix will be prepared (follow-up to #140) ...

ffwema commented 3 months ago

@c72578 thanks for the tip, didn't occur to me to try with UTF-8-BOM encoding as source (which indeed works without issues). I only switched from UTF-8-BOM to UTF-8 cuesheets due to some past issues (unrelated to CUETools) and after learning that "BOM is neither required nor recommended for UTF-8" (https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-with-bom/2223926#2223926).

c72578 commented 3 months ago

@ffwema Could you please test the build from #327 using your cuesheets in UTF-8 format (without BOM).

ffwema commented 3 months ago

@c72578 The linked build works flawlessly, thank you (tested on ca. 250 cuesheets that contain various special characters).

c72578 commented 3 months ago

@ffwema Thanks for testing.