This patch replaces the previous broken approach to TOC string decoding
that used `.encode().decode('unicode_escape')` with proper parsing of
the escape sequences cdrdao is known to generate.
The new parser is also lenient with invalid escape sequences, that can
occur due to improper escaping in cdrdao. See:
https://github.com/cdrdao/cdrdao/issues/32
Latin-1:
This new parsing method should work for Latin-1 strings for both old and
new versions of cdrdao, as long as those strings don't trigger the
improper escaping issues in upstream cdrdao.
This has been verified with the album Diorama from the Danish black
metal band MØL.
MS-JIS:
This new parsing method should also work for MS-JIS strings as long as
the .toc file was generated by cdrdao 1.2.5+ and the strings don't
trigger improper escaping issues in upstream cdrdao.
Unfortunately, I don't have any CD with CD-Text in MS-JIS, so I could
not verify this.
cdrdao versions before 1.2.5 will still cause whipper to produce
mojibake (garbled characters) when reading MS-JIS CD-Text, as those
versions do not encode strings in UTF-8.
Other encodings:
As far as I know, CD-Text only supports officially ASCII, Latin-1 and
MS-JIS, but I wouldn't be surprised if there are unofficial encodings
out there, given the strange strings I've seen in some bug reports.
If you have a CD with garbled CD-Text, please submit a bug report
indicating the performer, album name, language and attach the .toc file
so that the produced strings can be compared to the expected text.
Fixes https://github.com/whipper-team/whipper/issues/169
Signed-off-by: Alicia Boya García <ntrrgc@gmail.com>
46 lines
948 B
CUE
46 lines
948 B
CUE
REM DISCID 700AC908
|
|
REM COMMENT "whipper 0.10.1.dev27+ga4b9742.d20240827"
|
|
PERFORMER "MØL"
|
|
TITLE "Diorama"
|
|
FILE "data.wav" WAVE
|
|
TRACK 01 AUDIO
|
|
PERFORMER "MØL"
|
|
TITLE "Fraktur"
|
|
ISRC DED832100085
|
|
INDEX 01 00:00:00
|
|
TRACK 02 AUDIO
|
|
PERFORMER "MØL"
|
|
TITLE "Photophobic"
|
|
ISRC DED832100086
|
|
INDEX 01 04:19:00
|
|
TRACK 03 AUDIO
|
|
PERFORMER "MØL"
|
|
TITLE "Serf"
|
|
ISRC DED832100087
|
|
INDEX 01 09:37:00
|
|
TRACK 04 AUDIO
|
|
PERFORMER "MØL"
|
|
TITLE "Vestige"
|
|
ISRC DED832100088
|
|
INDEX 01 14:59:12
|
|
TRACK 05 AUDIO
|
|
PERFORMER "MØL"
|
|
TITLE "Redacted"
|
|
ISRC DED832100089
|
|
INDEX 01 20:37:68
|
|
TRACK 06 AUDIO
|
|
PERFORMER "MØL"
|
|
TITLE "Itinerari"
|
|
ISRC DED832100090
|
|
INDEX 01 25:54:18
|
|
TRACK 07 AUDIO
|
|
PERFORMER "MØL"
|
|
TITLE "Tvesind"
|
|
ISRC DED832100091
|
|
INDEX 01 30:57:58
|
|
TRACK 08 AUDIO
|
|
PERFORMER "MØL"
|
|
TITLE "Diorama"
|
|
ISRC DED832100092
|
|
INDEX 01 38:46:57
|