title: How can I force HtmlUnit to parse a Javascript file in UTF-8 in a GWT Test Case?
body: <p>I'm writing a GWTTestCase on a GWT Module including an external Javascript file which contains non-ASCII characters in variables names (d3.js).</p>
  
  <p>I get this Error :</p>
  
  <pre><code>SEVERE: error: message=[illegal character] sourceName=[http://d3js.org/d3.v3.js] line=[2098] lineSource=[    var Î»00, Ï00, Î»0, cosÏ0, sinÏ0;] lineOffset=[10]
  </code></pre>
  
  <p>here is the line of code at line 2098 :</p>
  
  <pre><code>var λ00, φ00, λ0, cosφ0, sinφ0;
  </code></pre>
  
  <p>According to HtmlUnit, these characters (λ and φ) are valid Javascript identifier characters (see <a href="http://grepcode.com/file/repo1.maven.org/maven2/net.sourceforge.htmlunit/htmlunit-core-js/2.9/net/sourceforge/htmlunit/corejs/javascript/TokenStream.java?av=f#360" rel="nofollow">the source code</a>) and browsers have no problem parsing it. Unfortunately, HtmlUnit seems to read the file using ISO-8859-1 encoding (as you can see in the error message), while it is UTF-8 encoded.</p>
  
  <p>How can I force HtmlUnit to use UTF-8 encoding to parse the Javascript file ?</p>
  
  <p>I tried to add the option -Dfile.encoding=UTF8 in Eclipse and in Maven configuration, but it didn't help.
  Is there a way to configure HtmlUnit by overriding some method in GWTTestCase ?</p>
  
  <p>Thanks for your help.</p>