Filepath encoding ANSI UTF-8 question

i'm using the export script to modify timestamps from here:

(for readers: this sets file modification dates according to a value from a mp3tag tag)

works as expected most of the time.
But as the export script (needs?) to run with ANSI if have problems with files and paths which have special characters. Those files were of course not found when i execute the generated vb script.

I've tried to convert the vb script with notepad++ to utf-8, but this doesn't cut it.

How would the mp3tag pros tackle this issue?

Where does this requirement come from?

You can set the character encoding for the export script output as documented:

the first line of the export.mte is:
$filename($getEnv('USERPROFILE')'\Desktop\SetFileModDateTime.vbs',ANSI)

runs fine as i said

as soon as i change this to:
$filename($getEnv('USERPROFILE')'\Desktop\SetFileModDateTime.vbs',utf-8)

it errors out with a wscript error: invalid char in line 1 when i execute the generated vbscript.

because of that i thought it's a requirement. I'm not a vbscript pro

I do not get an error if I generate the export in UTF-8 but without writing the BOM.
See the Options>Export.

i also didn't get it when BOM is disabled. But now i get "file not found" (the ones created through this export.)
Unfortunately the line number for the error is not the file which isn't found but instead the line of the function which should set it:

Set objFile = objFSO.GetFile(strMp3tagPath)

but doesn't matter, i've checked it, it errors out on every file, so here one for example:

\Adam Bałdych & Helge Lien Trio\Bridges.flac

look at the "l" in "Baldych" this is the culprit it guess....

i can cd to the folder/file within a dos prompt. Dunno why the script errors out.

You can edit the script with a plain text editor and check if the generated path is actually readable.

as i said, the actual line is:

"M:\Adam Bałdych & Helge Lien Trio\Bridges [24 Bit]\02 - Polesie.flac"

if i cut'n paste the path into a dos window it is accesible

solved it. In another forum i've found the info, that vb scripts cannot run with utf-8 correctly. It needs to be utf-16.
This solved it!
Now running fine.