Creating multiple M3u8 playlists

Hi
I have loaded into MP3tag all the tracks that I have rated in iTunes (having exported them) and from this list I want to create a separate playlist for each Artist. I then import these individual playlists into iTunes

This works fine for the vast majority of artists/tracks but when there are unicode (UTF-8) characters in either the artist name, album name or track title these tracks or in some cases entire playlists are missing - e.g. Blue Öyster Cult

The export configuration code is as follows (I have created two actions/export configs which run one after the other within an action group). The first creates the filename with the first line populated with EXTM3U. The second then loops round each artist/track and enters each track in the playlist

$filename(\\\\NAS\Music\Artist Playlists\$if($eql(%albumartist%,Various Artists),$cutleft(%album%,6),$if($eql(%_parent_directory%,1Pop),Miscellaneous Pop,$if($eql(%_parent_directory%,\\\\NAS\Music),Miscellaneous Artists,$regexp(%_folderpath%,'^\\\\.+?\\\\.+?\\\\.+?\\\\(.+?)\\\\.*',$1)))) - Rated Tracks.m3u)#EXTM3U

$loop(%path%)#EXTINF:%_length_seconds%,%artist% - %title%
$replace(%_path%,'\\\\NAS\Music\MP3\','M:\MP3\')
$loopend()

I thought that all I would need to do to get this to become a UTF-8 playlist was change the extension from .m3u to .m3u8. However although all the playlists are generated now with the m3u8 extension, any with unicode characters are still not being picked up when imported into iTunes. I am obviously missing something in creating these as UTF-8 playlists, but I don't know what it is.

Any ideas

tia
G

Check this export script if it works ...

01: $filename($getEnv('USERPROFILE')'\Desktop\Mp3tag.Playlist.m3u8',UTF-8)'#EXTM3U'

02: $loop(%_path%)'#EXTINF:'%_length_seconds%','%ARTIST%' - '%TITLE%
03: $replace(%_path%,'\\NAS\Music\MP3<!--colorc-->','M:\MP3<!--colorc-->')
04: $loopend()

Check possible spelling error at ...
'\\NAS\Music\Miscellaneous Artists'

Check the filename assembling ...

$filename('\\\\NAS\Music\Artist Playlists\'$if($eql(%ALBUMARTIST%,'Various Artists'),$cutLeft(%ALBUM%,6),$if($eql(%_parent_directory%,'1Pop'),'Miscellaneous Pop',$if($eql(%_parent_directory%,'???'),'Miscellaneous Artists',$regexp(%_folderpath%,'^\\\\.+?\\\\.+?\\\\.+?\\\\(.+?)\\\\.*','$1'))))' - Rated Tracks.m3u')

DD.20140503.1717.CEST

Thanks - I have added ,utf-8 to end of $filename. Note the filename assembling has worked fine - it just gives me a different filename depending on where the track is located. Do I need to change the filename in the Export File Name box at the bottom of the Export configuration screen. I did try adding ,utf-8 to this but it just appended that to the file extention which became .m3u8,utf-8 which was not what I was after

$filename(\\\\NAS\Music\Artist Playlists\$if($eql(%albumartist%,Various Artists),$cutleft(%album%,6),$if($eql(%_parent_directory%,1Pop),Miscellaneous Pop,$if($eql(%_parent_directory%,\\\\NAS\Music),Miscellaneous Artists,$regexp(%_folderpath%,'^\\\\.+?\\\\.+?\\\\.+?\\\\(.+?)\\\\.*',$1)))) - Rated Tracks.m3u8,utf-8)#EXTM3U

and it has done something because when I look at the resultant file in notepad I now see

#EXTM3U
#EXTINF:263,Agnetha F�ltskog - Can't Shake Loose
M:\MP3\Agnetha F�ltskog\1983 - Wrap Your Arms Around Me (Remastered 2005)\02 - Can't Shake Loose.mp3

Instead of previously:

#EXTM3U
#EXTINF:263,Agnetha Fältskog - Can't Shake Loose
M:\MP3\Agnetha Fältskog\1983 - Wrap Your Arms Around Me (Remastered 2005)\02 - Can't Shake Loose.mp3

However nothing loads in iTunes from this new file still.

I tested creating a playlist for this artist using the Playlist option under the File menu and selected M3U8 as the filetype it works fine - the resultant file shows the correct character in Notepad and it imports correctly into iTunes!

From the help manual:
You can set the filename of the exported file with the function $filename(name[,enc]). The optional second parameter sets the encoding of the export file. Possible values are ansi, utf-8 and utf-16.

Sorry, I do not know what character encoding is needed for importing into iTunes.
If you want to write a m3u8 playlist, then the encoding must be set to UTF-8.

In the dialog "Export", after you have manually changed the filename declaration in the export script file, then move the selection bar up and down over the menu script entry, to force Mp3tag to use the changed declaration.

Hm, I thought there is something weird with the comparison regarding %_parent_directory% and with the $if nesting.

DD.20140503.1819.CEST