title: Java, UTF-8, and Windows console
body: <p>We try to use Java and UTF-8 on Windows. The application writes logs on the console, and we would like to use UTF-8 for the logs as our application has internationalized logs.</p>
  
  <p>It is possible to configure the JVM so it generates UTF-8, using <code>-Dfile.encoding=UTF-8</code> as arguments to the JVM. It works fine, but the output on a Windows console is garbled.</p>
  
  <p>Then, we can set the code page of the console to 65001 (<code>chcp 65001</code>), but in this case, the <code>.bat</code> files do not work. This means that when we try to launch our application through our script (named start.bat), absolutely nothing happens. The command simple returns:</p>
  
  <pre><code>C:\Application&gt; chcp 65001
  Activated code page: 65001
  C:\Application&gt; start.bat
  
  C:\Application&gt;
  </code></pre>
  
  <p>But without <code>chcp 65001</code>, there is no problem, and the application can be launched.</p>
  
  <p>Any hints about that?</p>