Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: 1.4b15 writes wrong 'Unicoded' filenames in cuesheets when converting to image (Read 1377 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

1.4b15 writes wrong 'Unicoded' filenames in cuesheets when converting to image

Edit: maybe delete "filenames in" from the subject. Probably a UTF-8 BOM issue.

Did the following:

Folder with "em space" 0x2003. 
I pick two FLAC tracks from the folder, convert to WAV image with filename <nameoffolder>.wav.
Drag resulting cuesheet into foobar2000 playlist. Notice: question marks instead of duration for the second file.
Try to play the first.

Result when the above conversion is done in 1.4b15:
"Unable to open item for playback (Invalid path syntax):"
Playback with a portable out-of-the-box 1.3.15 yields same result.

Now do the same conversion except in version 1.3.15.
Result: Plays well! In both 1.3.15 and in 1.4b15.


Going back to the 1.4b15-created cuesheet.
Open it in Notepad++. Correct the filename by cut and paste. Try to save. No cigar.
- I need to change encoding to UTF-8 to get it saved properly, but then fb2k cannot find the file.
- But if I change encoding to "UTF-8-BOM": voilà!


So 1.4b15 messes up the byte order mark, right?

Re: 1.4b15 writes wrong 'Unicoded' filenames in cuesheets when converting to image

Reply #1
I can confirm the misbehavior, we do not write Unicode in cuesheets, only the closest system codepage matches. The cuesheet format does not support Unicode, or at least there is no defined standard saying which of the many ways to encode Unicode should be used.

We do however read cuesheets with UTF-8 BOM as UTF-8, as you have observed.

I have no idea how you got an old version to write a working cuesheet though, as far as I can tell the behavior is consistent between 1.3 and 1.4 series.

I can't just start writing cuesheets with UTF-8 BOM because it is unknown how other software (CD burners in particular) will react to such files. The best I can do for now is to add an opt-in in advanced preferences.
Microsoft Windows: We can't script here, this is bat country.

Re: 1.4b15 writes wrong 'Unicoded' filenames in cuesheets when converting to image

Reply #2
@Peter : I suppose that would be quite sought after checkbox, looking at how many complaints about "?" strings have accumulated in forum during these years, especially from those using Cyrylic-written languages as well as far east Asian languages (Chinese, Japanese). They sometimes complain, that after editing single cue sheet entry using Properties window, they got long "?" strings in all entries from certain cue sheet, or that some cue sheets give some characters artifacts when loaded in foobar, despite they do work in Notepad.

Info about reading UTF-8 BOM containing cue sheets seems to be very useful in this context. Is it possible to easily save cue sheet in Notepad so it will have UTF-8 BOM? Notepad offers to save as ANSI, Unicode, Unicode BE, UTF-8 (just UFT-8, no more info is given in Save As window).
Is there also an easy way to check if cue sheet contain UTF-8 BOM or generally, to check how it is encoded?

Re: 1.4b15 writes wrong 'Unicoded' filenames in cuesheets when converting to image

Reply #3
Is there also an easy way to check if cue sheet contain UTF-8 BOM or generally, to check how it is encoded?
At least  there is easy way to save cuesheet in UTF-8 with BOM or without BOM. Menu "Encoding" in Notepad++
And if you simply edit (and write some unicode characters) and save cue file as UTF-8 in standard Windows Notepad, you will get cue that will work correctly in fb2k. So, obviously, UTF-8 in Notepad is actually UTF-8 with BOM.
And, after you save cue as UTF-8 in Notepad, you can edit and save it in fb2k and write unicode characters and everything will be saved correctly.

Re: 1.4b15 writes wrong 'Unicoded' filenames in cuesheets when converting to image

Reply #4
Strictly speaking, a file has UTF-8 BOM if it starts with these bytes: EF BB BF. You can check this with a hex editor.
Notepad++ works too.

Note that if you use embedded cuesheets, none of these issues are relevant, as embedded cuesheets rely on text encoding used by your file format's tags. So it's just standalone cuesheets that are problematic.
Microsoft Windows: We can't script here, this is bat country.

Re: 1.4b15 writes wrong 'Unicoded' filenames in cuesheets when converting to image

Reply #5
1.4 beta 20 has option in Advanced preferences to write UTF-8 cue.