From: Guillaume L. <gu...@gm...> - 2017-06-21 08:52:15
|
Hello every one I'm trying to use HtmlUnit to connect a webpage, but a javascript has some accent characters (like é or è or à) and it throws an exception. The code to reproduce the issue is very simple : * String urlDepart = "https://www.ca-languedoc.fr/ <https://www.ca-languedoc.fr/>";* * try (WebClient webClient = new WebClient(BrowserVersion.CHROME)) {* * HtmlPage page = webClient.getPage(urlDepart);* * String title = page.getTitleText();* * System.out.println("Title : "+title);* * }* The page is : https://www.ca-languedoc.fr/Vitrine/ObjCommun/js/xiti.js I tried to add the "-Dfile.encoding=UTF-8" but it didn't solve the problem. Do you have any idea about it ? I'm using HTML Unit 2.27, from maven : <dependency> <groupId>net.sourceforge.htmlunit</groupId> <artifactId>htmlunit</artifactId> <version>2.27</version> </dependency> Thank you for your help :) Guillaume |