I have several special character url\'s i have to connect to with Jsoup.connect(string), but it fails to load the page (getting a error 500). I\'m not really that much into
How stupid of me, Instead of just encoding the query string, i encoded the whole URL..
Solved by doing this:
String placesUrl = String.format("https://maps.googleapis.com/maps/api/place/textsearch/xml?query=%s&sensor=false&key=XX&radius=10",URLEncoder.encode(restaurantListe[i][0],"UTF-8"));
Thanks for the help!
Running into URL-encoding problems, I'd recommend you parse your request using a URL encoder tool first (StackOverflow answer regarding those). One already comes with Java.
URLEncoder.encode(stringToBeEncoded, "UTF-8")
Using it on your unformatted string above, it should look something like:
Document gDoc = JSoup.connect(placesURL.format(URLEncoder.encode(queryString, "UTF-8"));
... as to not URL-encode your entire URL, just the part of the query you need to be UTF-8 (or UTF-16) compliant.