Generating export for M3U8 Playlists - UTF-8 issue

this thread features an export script that deletes a trailing comma.
So perhaps a double somersault where you first insert a unique character after each track, then remove the trailing one and finally replace the unique characters with carriage return and line feed characters.