Could we please have a $filename("path",unicode) export encoding?
When creating Batch Files, neither ansi nor utf-8 or utf-16 work when exporting a file path, like in:
$filename("test.bat")$loop(%_path%)echo "%_path%"
$loopend()
For a real path of
M:\MP3\Tagged\Köllen, Achim\Köllen, Achim - Eine ganze Nacht mal (nicht vernünftig sein).mp3
this will display
M:\MP3\Tagged\K÷llen, Achim\K÷llen, Achim - Eine ganze Nacht mal (nicht vern³nftig sein).mp3
instead.
Even worse (because »č« isn’t in the ANSI character set for Germany (CP-1252)):
The real file path
M:\MP3\Tagged\Robič, Ivo\Robič, Ivo - Mit 17 fängt das Leben erst an.mp3
becomes
M:\MP3\Tagged\Robic, Ivo\Robic, Ivo - Mit 17 fängt das Leben erst an.mp3
in the export file, which in turn will display
M:\MP3\Tagged\Robic, Ivo\Robic, Ivo - Mit 17 fõngt das Leben erst an.mp3
in the »DOS Box«!
Of course this is due to the ANSI character set not being translated into the OEM character set needed by DOS Batch Files. One could now try to convert into the OEM character set (which will fail for example 2), but why not use the command processor’s ability to handle what they call »Unicode«?
I believe this to be actually a UTF-16 LE (no BOM) format, but I’m not 100% certain.
So I kindly ask if we could please have something that will write out in a (Unicode) format compatible to the system’s batch file processor?
Sometimes it seems unavoidable to come up with fancy workarounds for some things—in this case, a function like this would be a great help! (See an example here.)