title: Visual Studio Code: terminal input accents (java.util.Scanner)
body: <p>I wrote a very simple Java program and, trying to input a string with some accents, I noticed that Scanner (or the terminal) has issues to handle them.</p>
  
  <p>I don't know how to resolve this problem with encoding.</p>
  
  <h3>Code</h3>
  
  <pre><code>    System.out.println("aeíóu"); // output =&gt; aeíóu
  
      Scanner input = new Scanner(System.in, "UTF-8");
      String str = input.nextLine(); // input =&gt; aeíóu
      input.close();
      System.out.println(str); // output =&gt; ae  u
  </code></pre>
  
  <h3>Outputs (Visual Studio Code)</h3>
  
  <ul>
  <li><p>Java Process Console:</p>
  
  <p><a href="https://i.stack.imgur.com/ExcJX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ExcJX.jpg" alt="enter image description here"></a></p></li>
  <li><p>cmd:</p>
  
  <p><a href="https://i.stack.imgur.com/GMX92.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GMX92.jpg" alt="enter image description here"></a></p></li>
  </ul>
  
  <h3>Enviroment</h3>
  
  <ul>
  <li>OS: Windows 10 Pro</li>
  <li>JDK: 1.8.0_231 </li>
  <li>Visual Studio Code: 1.39.2</li>
  </ul>