Closed spand closed 4 years ago
Good catch @spand! This looks like a quick fix but I'm scratching my head trying to figure out how to write a unit test for this. To your knowledge, is there anyway to programmatically change the default charset for a single test case or is that only something that can be set before the JVM starts up?
I'd also gladly accept a PR for this if you/anyone else is feeling up for it.
It is not possible to set programmatically to my knowledge (internet would seem to agree) other than maybe doing some crazy Classloader magic.
URLHelper is calling platform dependent String.getBytes() here:
But as far as I know base64 encoding for urls require UTF-8 to be used and should be specified explicitly here.
Running this example program:
with -Dfile.encoding=UTF-8 and -Dfile.encoding=UTF-32 respectively demonstrates the problem: