enzo1982 / freac

The fre:ac audio converter project
https://www.freac.org/
GNU General Public License v2.0
1.38k stars 71 forks source link

Special characters in artist and track names rendered differently. #388

Open Benedict-1966 opened 1 year ago

Benedict-1966 commented 1 year ago

Describe the bug Letter 'ö' in artist name renders as '^' in m3u playlist file.

Fre:ac generated following m3u playlist file content for Björk's Homogenic album CD:

Begin of file content

EXTM3U

EXTINF:255,Bjˆrk - Hunter

Bjˆrk - Homogenic - (1997) - (Art Pop, electronic)/01 - Bjˆrk - Hunter.mp3

EXTINF:305,Bjˆrk - JÛga

Bjˆrk - Homogenic - (1997) - (Art Pop, electronic)/02 - Bjˆrk - JÛga.mp3

EXTINF:202,Bjˆrk - Unravel

Bjˆrk - Homogenic - (1997) - (Art Pop, electronic)/03 - Bjˆrk - Unravel.mp3

EXTINF:313,Bjˆrk - Bachelorette

Bjˆrk - Homogenic - (1997) - (Art Pop, electronic)/04 - Bjˆrk - Bachelorette.mp3

EXTINF:353,Bjˆrk - All Neon Like

Bjˆrk - Homogenic - (1997) - (Art Pop, electronic)/05 - Bjˆrk - All Neon Like.mp3

EXTINF:269,Bjˆrk - Five Years

Bjˆrk - Homogenic - (1997) - (Art Pop, electronic)/06 - Bjˆrk - Five Years.mp3

EXTINF:186,Bjˆrk - Immature

Bjˆrk - Homogenic - (1997) - (Art Pop, electronic)/07 - Bjˆrk - Immature.mp3

EXTINF:260,Bjˆrk - Alarm Call

Bjˆrk - Homogenic - (1997) - (Art Pop, electronic)/08 - Bjˆrk - Alarm Call.mp3

EXTINF:199,Bjˆrk - Pluto

Bjˆrk - Homogenic - (1997) - (Art Pop, electronic)/09 - Bjˆrk - Pluto.mp3

EXTINF:273,Bjˆrk - All Is Full Of Love

Bjˆrk - Homogenic - (1997) - (Art Pop, electronic)/10 - Bjˆrk - All Is Full Of Love.mp3 End of file content

The second track title of the album Jóga is rendered as JÛga which is also problematic. In the file naming of the m3u file the original letters are preserved. Also in the file naming of the generated mp3 files the original letters are preserved.

To Reproduce Load a CD of an artist of whom's name an/or tracks have special characters such as 'ö', 'ó', etc Query CDDB database Start the encoding process including the creation of a m3u playlist file.

Expected behavior Special characters in artist and/or track names should not appear altered in the m3u playlist file because for example the Music app in macOS 12.06.1 does not read them and skips them in its listing.

System

Additional context I use a remote shared CD/DVD drive that is part of a mackintosh running OS X 10.6.7 connected to my local network.

Ask if you need more info. Hope this is of any help.

enzo1982 commented 1 year ago

The .m3u format uses 8 bit characters which need to be interpreted in the same encoding by the writing and reading application.

fre:ac traditionally uses ISO-8859-1 as the encoding of .m3u files. Apple Music, on the other hand, seems to interpret the files in the MacRoman encoding. ISO-8859-1 has ó and ö at the codepoints where MacRoman has Û and ˆ.

I will consider changing the way fre:ac writes .m3u files to use the current system encoding. That way, the files would be written in CP1252 (mostly compatible with ISO-8859-1) on Windows computers configured to a Western European language, and as MacRoman on Macs. Naturally, such files would not be interchangeable between Windows and Mac systems anymore then.

For best compatibility, configure fre:ac to create .m3u8 playlists (called M3U Playlist (Unicode) in fre:ac). Those use the UTF-8 Unicode encoding and can represent tens of thousands of international characters in an interchangeable format. I'm not sure whether Apple Music supports .m3u8, though.

Lee-Carre commented 1 year ago

Mojibake strikes again.

Use a text editor (or CLI shell) which allows setting the character encoding scheme with which to parse text. Well designed & implemented software will allow you to configure how to parse .m3u files in future, separately to the global default for other text files. I know that Emacs can do this, but am not sure about Vim.

Unicode & UTF-8 for the win. Solves so many problems.

I'm not sure whether Apple Music supports .m3u8, though.

When even Microsoft has decent Unicode implementation (and for quite some time), then surely Apple should/must. Though, .m3u8 specifically will likely come down to the specific user-land app being used.