How to lose time with something you can't see...
While working I encounter a strange exception:
java.net.URISyntaxException: Illegal character in query at index 79: http:// ...
Strange, because there was no special character in my URL. The index 79 was here:
&v4003= ^
I couldn't figure out what the problem was... Then I decided to try something out:
System.out.println(URLEncoder.encode("v4003=", "UTF-8"));
And the output was
v%E2%80%8B4003%3D
So, what is this %E2%80%8B? After so many years I learned for the first time that this is the zero width space character. A very devious character, really!
So, how did this character came in my URL? It was a result of (of course) a copy paste from the google docs. I was too lazy to write 4000 with the keyboard. And laziness is something that always creates strange problems.