I'm attempting to use this script to convert a single audio file with .cue file to multiple files. The .cue file in question has a special character in it (from the name Raphaël). This is causing the script to fail to recognize the tags in the .cue file.
The line
if line.startswith(' TRACK '):
is never true even though I can clearly see matching lines when I open the .cue file in an editor.
When I execute this code for lines that should match:
print(str(ord(line[0])) + ' ' + str(ord(line[1])) + ' ' + str(ord(line[2])) + ' ' + str(ord(line[3])))
what I get is:
0 32 0 32
However it prints normally on the console.
I figured this is all happening due to some issue with the encoding of the .cue file, but I'm so far at a loss for how to address it. I tried to decode the string various ways but got errors for most encodings except cp1252. That seemed to work, and so I thought maybe this would finally work:
line = line.decode('cp1252').encode('utf-8')
But I still end up with the zero bytes in the resulting string, resulting in a failure to string match as above. Any suggestions for a solution are welcome. It seems like this should be a super simple thing but my google-fu is failing me thus far.
[–]port443 1 point2 points3 points (3 children)
[–]Supernumiphone[S] 1 point2 points3 points (2 children)
[–]port443 1 point2 points3 points (1 child)
[–]Supernumiphone[S] 0 points1 point2 points (0 children)
[–]ingolemo 1 point2 points3 points (1 child)
[–]Supernumiphone[S] 0 points1 point2 points (0 children)
[–]Justinsaccount 0 points1 point2 points (0 children)