I try to open a website by using `driver.get(url):
driver = new HtmlUnitDriver(BrowserVersion.CHROME);
driver.setJavascriptEnabled(true);
driver.setAcceptSslCertificates(true);
driver.setDownloadImages(true);
driver.get(<private url>);
However, the URL contains an 'Ö', a german Umlaut. So the driver replaces 'ö' with '%D6'
So it opens a wrong site.
I tried changing to UTF-8 in Eclipse; didn't work.
Also using unicode didn't work.
Does anyone have an idea?
Your case works with 2.27-SNAPSHOT.
indexÖ.html:
<body>Ö</body>
Java code:
WebDriver driver = new HtmlUnitDriver();
driver.get("http://localhost:8080/indexÖ.html");
System.out.println(driver.getPageSource());
Output:
<?xml version="1.0" encoding="ISO-8859-1"?>
<html>
<head/>
<body>
Ã
</body>
</html>
which is what real Chrome also shows.
As you said, ensure your all workspace is in UTF-8:

And if you are using maven:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>