Intento abrir un sitio web usando `driver.get(url):
driver = new HtmlUnitDriver(BrowserVersion.CHROME); driver.setJavascriptEnabled(true); driver.setAcceptSslCertificates(true); driver.setDownloadImages(true); driver.get(<private url>);Sin embargo, la URL contiene un 'Ö', una diéresis alemana. Entonces el controlador reemplaza 'ö' con '% D6'
Así que abre un sitio equivocado.
Intenté cambiar a UTF-8 en Eclipse; no funcionó
Además, usar Unicode no funcionó.
¿Alguien tiene alguna idea?
Su caso funciona con 2.27-SNAPSHOT .
indexÖ.html:
<body>Ö</body>Código Java:
WebDriver driver = new HtmlUnitDriver(); driver.get("http://localhost:8080/indexÖ.html"); System.out.println(driver.getPageSource());Producción:
<?xml version="1.0" encoding="ISO-8859-1"?> <html> <head/> <body> Ã </body> </html>que es lo que también muestra Chrome real.
Como dijiste, asegúrate de que todo tu espacio de trabajo esté en UTF-8: 
Y si estás usando maven:
<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties>