Doesn't work at all.
When you do stupid shit like this with file names you can expect this type of error.
This is from developers trying to act more big brain than they are!
There is no need to use something like encodeURIComponent. You are making shit more complicated than you need to when you do that.
There are to many things that can go wrong with schemes like this. What are you protecting anyways with this? It's just stupid. This type of shit is something you would use on a website if you are trying to prevent people from simply downloading a directory of images. Don't use stupid shit like this in a game engine.
View attachment 865747