so I arrived at the following mp3tag formatting string, it supports encoding of all forbidden unix/windows filename characters and the hyphen sign “-” and the percent sign “%”, and uses the supported multi-disc directory structure
without url encoding
%albumartist%\%album%\Disc $num(%discnumber%,2)\$num(%track%,2). %artist% - %title%
with url encoding of characters < > : " \ / | ? * - %
$replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace(%albumartist%,'-','%2D'),'*','%2A'),'?','%3F'),'|','%7C'),'/','%2F'),'\','%5C'),'"','%22'),':','%3A'),'>','%3E'),'<','%3C'),'%','%25')\$replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace(%album%,'-','%2D'),'*','%2A'),'?','%3F'),'|','%7C'),'/','%2F'),'\','%5C'),'"','%22'),':','%3A'),'>','%3E'),'<','%3C'),'%','%25')\Disc $num(%discnumber%,2)\$num(%track%,2). $replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace(%artist%,'-','%2D'),'*','%2A'),'?','%3F'),'|','%7C'),'/','%2F'),'\','%5C'),'"','%22'),':','%3A'),'>','%3E'),'<','%3C'),'%','%25') - $replace($replace($replace($replace($replace($replace($replace($replace($replace($replace($replace(%title%,'-','%2D'),'*','%2A'),'?','%3F'),'|','%7C'),'/','%2F'),'\','%5C'),'"','%22'),':','%3A'),'>','%3E'),'<','%3C'),'%','%25')
for example, the directory for the album
Now That’s What I Call Music! 1981: The Millennium Series
will be translated into
Now That’s What I Call Music! 1981%3A The Millennium Series
same goes for albumartist,album,artist,title