A certain site (which is not under my control) has an internal search engine that uses GET requests that look like: something.com/search?query=%u0001%0101
, which I would like to use in my Java code .
To my understanding this is a not so common way (UTF-16) to do Url encoding. I tried using HttpURLConnection with a Url of the above type, but this throws me a java.net.URISyntaxException Malformed escape pair at index X
(X being the position of the %u0001).
What can I do? I'm pretty new to these url encoding issues, so any advice would be highly appreciated.