_DIRECTORY formatting issue with non alphanumeric characters

I have an action to place songs in the %artist%%album% folder, and it works ok for alphanumeric characters (lower and upper case and numbers) but not special characters like $ let alone Unicode.

Here's my action:

Format value: Field =_DIRECTORY Format string = E:\Media\Music\%artist%\%album%

I've tried it both with and without a trailing slash at the end of the format string, and it doesn't affect it at all.

Try it yourself, Put A$ap Rocky or $uicideBoy$ in the artist field then apply the action, it won't work.

Are you on Windows or macOS?

Besides that, it looks like a backslash is missing between the fixed and variable parts of the format string. Can you try with
E:\Media\Music\%artist%%album%

apparently, you have to use the $validate() function

should be
Format string = $validate(E:\Media\Music%artist%%album%,_)

No, there's no backslash missing between Music and the variables, I just did a typo on accident when I copied it here.

In fact, I didn't even make a typo, your forum software ate that slash.

Thanks for this, I didn't know about the validate function.