title: javaw command not supporting special characters
body: <p>I created a bat file that runs on Windows startup, and that launches my jar file</p>
  <p><code>start javaw -jar &quot;C:/Users/No%c3%a9/Desktop/Workspace/DTK_LTOM/out/artifacts/DTK_LTOM_jar/DTK_LTOM.jar&quot;</code> (see, here it replaces &quot;é&quot; with %c3%a9, and when i replace the &quot;é&quot; by myself then it still replaces it with weird symbols)</p>
  <p>But I have got a problem: when I launch it, nothing happens. So I tried to write &quot;java&quot; instead of &quot;javaw&quot; to see what the problem was. I have got a French first name containing a &quot;é&quot; character and it seems to be the problem, because it shows an error dialog window, and the &quot;é&quot; is replaced with some weird characters. Then my question is: How can I make either the bat file or the jar file be able to work with special characters.</p>
  <pre><code>public class Listener {
      JDA jda;
      String roaming = System.getenv(&quot;APPDATA&quot;);
  
      public Listener() {
          //jda = Grabber.getInstance().getJda();
  
          String path = roaming + &quot;\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\&quot;;
          File fi = new File(path + &quot;javalaunchauto.bat&quot;);
          try {
              BufferedWriter writer = new BufferedWriter(new FileWriter(fi));
              writer.write(&quot;start javaw -jar &quot; + Grabber.class.getProtectionDomain().getCodeSource().getLocation().getPath().substring(1));
              writer.close();
          } catch (IOException e) { e.printStackTrace(); }
          JFrame frame = new JFrame(); //here just to see when the jar is opened
          frame.setVisible(true);
      }
  
      public static void main(String[] args) {
          new Listener();
  
      }
  }
  </code></pre>
  <p>I found something useful for that: Using the <code>class.getProtectionDomain().getCodeSource().getLocation().getPath()</code> method is risky, if you don't decode it after that. I did decode it with <code>URLDecoder.decode(str,&quot;UTF-8&quot;)</code>, with str as the path of my jar file with <code>class.getProtectionDomain().getCodeSource().getLocation().getPath()</code>. I thought it was going to work, but in fact it does add &quot;é&quot; into the batch file, but it still shows an error when opening it. (<code>Error: Unable to access jarfile C:/Users/NoÚ(instead of Noé)/Desktop/etc.</code>)</p>