It's usually used for streaming purposes, servers, etc. They don't care about extension, but the file content.
You may have track names on the file as UTF-8, but the files may have other encoding. Also some programs can read the UTF-8 m3u8 file but not manage tracks with names encoded like that... (even if that makes no sense).
There is an interminable list of #directives used on streaming programs. And even playlists pointing to playlists. You can also have a playlist name different than the filename. For example, to have duration, artist and title while streaming then the playlist must be formatted like this:
...
let playlistText = [];
playlistText.push('#EXTM3U');
playlistText.push('#EXTENC:UTF-8');
playlistText.push('#PLAYLIST:' + playlistName);
playlistText.push('#PLAYLISTSIZE:');
if (playlistIndex != -1) { // Tracks from playlist
let trackText = [];
// var tfo = fb.TitleFormat('%path%');
var tfo = fb.TitleFormat('#EXTINF:%_length_seconds%,%artist% - %title%$crlf()' + '%path%');
var items = plman.GetPlaylistItems(playlistIndex);
trackText = tfo.EvalWithMetadbs(items);
playlistText[3] += items.Count; // Add number of tracks to size
playlistText = playlistText.concat(trackText);
} else { // Else empty playlist
playlistText[3] += 0; // Add number of tracks to size
}
#EXTM3U
#EXTENC:UTF-8
#PLAYLIST:Filter Results
#PLAYLISTSIZE:7
#EXTINF:154,Exuma - Don't let go
D:\foobar2000\_\510 Don't let go.mp3
#EXTINF:372,Faris Amine Bottazzi - Alwaq semman
D:\foobar2000\_\494 Alwaq semman.mp3
#EXTINF:249,Hamza El Din - Anesigu
D:\foobar2000\_\504 Anesigu.mp3
#EXTINF:276,Hamza El Din - Childhood
D:\foobar2000\_\503 Childhood.mp3
#EXTINF:262,Hamza El Din - The message bearer
D:\foobar2000\_\496 The message bearer.mp3
#EXTINF:181,Tamikrest - Nak akaline tinza (tinzaouatene)
D:\foobar2000\_\500 Nak akaline tinza (tinzaouatene).mp3
#EXTINF:214,Terakaft - Imad halan
D:\foobar2000\_\508 Imad halan.mp3
May seem useless for many programs as you noted but in my use-case for the playlist manager, for example, there is no way to know how many tracks a playlist have without loading it, since I'm just showing a list of files. To bypass that limitation I can either count the number of lines (not #) for every playlist at playlist library reload (and then cache it) or just read the size directive. Name and tracks infos are useful for streaming, although I can also use name to set that as playlist name within foobar instead of the filename.
Anyway, for sure, the program must support all those standard directives to make playlist work right. Otherwise those lines just get skipped. If you create a playlist with those lines an open it on VLC for example, you will see the length, artist and title get loaded from the playlist even if it points to non existent files. Foobar seems to skip that info... so that seems to be more a limitation of foobar rather than the directives being useless.