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 URL's and such but i think it has somthing to do with the encoding used by JSoup.connect
Anyways, how would i proceed in order to allow links to have special characters like: Æ Ø Å è etc, The exception i'm getting is:
java.io.IOException: 500 error loading URL https://maps.googleapis.com/maps/api/place/textsearch/xml?query=Averøy%20restaurant%20og%20Pizzeria,%20Norge&sensor=false&key=xx&radius=10
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:414)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:391)
at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:157)
at org.jsoup.helper.HttpConnection.get(HttpConnection.java:146)
at HTMLParser.doParsing(HTMLParser.java:122)
at HTMLParser.initParser(HTMLParser.java:50)
at Main.main(Main.java:15)
The code which is producing this error is:
Document gDoc = Jsoup.connect(placesURL).get();
Where the placesURL string is:
https://maps.googleapis.com/maps/api/place/textsearch/xml?query=%s&sensor=false&key=XX&radius=10
Anyone have any idea to get around this?
Thanks!