gchudov / cuetools.net

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

Add setting for UTF-8-BOM #329

Closed c72578 closed 3 months ago

c72578 commented 3 months ago

This setting allows to enable/disable writing the byte-order mark (BOM) in case of UTF-8 encoded CUE sheets.

c72578 commented 3 months ago

Here is a build for testing: CUETools_2.2.5_2024-06-03_git_0e10505_Add setting for UTF-8-BOM.zip SHA256: 6f3764ed938cda94bd730d3d7b5dbd92c5306cb118e592279e8821f421f26b1b

Settings for creating UTF-8 encoded cue sheets without BOM:

AlwaysWriteUTF8CUEFile=1
WriteUTF8BOM=0
ffwema commented 3 months ago

Nice that this setting was added. Tested it with a few cuesheets (ANSI, UTF-8, UTF-8-BOM and UTF-16 LE BOM encoded) without issues. Although I would vote for WriteUTF8BOM=0 to be the default as I doubt any modern player has issues playing BOMless UTF-8 cuesheets.

c72578 commented 3 months ago

@ha-korth, what do you think about WriteUTF8BOM=0 as default?

ha-korth commented 3 months ago

The primary purpose for saving a CUE sheet is CD burning. That should be considered for the default. I don't have time to test right now but I know for example that ImgBurn supports UTF-8-BOM. I don't know if UTF-8 is supported.

ha-korth commented 3 months ago

I recommend leaving WriteUTF8BOM=1 as default. Characters mangled in ImgBurn and EAC "Write CD-R" when using UTF-8 encoded cue sheets without BOM. I didn't test further.

c72578 commented 3 months ago

I recommend leaving WriteUTF8BOM=1 as default. Characters mangled in ImgBurn and EAC "Write CD-R" when using UTF-8 encoded cue sheets without BOM. I didn't test further.

@ha-korth Thanks for the feedback and for checking ImgBurn and EAC.