title: ".bat" file isn't printing accents to a .txt file
body: <p>I'm using a .bat file for running a .jar program. The problem is that, even though the .bat file reads the input (aéí / lalélí / cácécí) it doesn't print them to the text file. (
  <a href="https://i.stack.imgur.com/EfKmf.png" rel="nofollow noreferrer">Image: CMD console output</a>
  )
  And you can see here the text file with the missing accents: <a href="https://i.stack.imgur.com/jEDId.png" rel="nofollow noreferrer">Image: Text file with missing accents</a></p>
  
  <p>Why do I tell you this? Because the <strong>Eclipse</strong> console successfully PRINTS accents to the file, but the BAT file doesn't do it. And I want to share a program with some friends. You may ask: "What do you have on your bat file"? I only have this, for running the jar file:</p>
  
  <blockquote>
    <p>java -jar crpg.jar</p>
  </blockquote>
  
  <p>And, obviously, you would ask about my code, I'll post it right now, but hey! My code works on Eclipse, the accents are succesfully printed in a text file, like you can see here: <a href="https://i.stack.imgur.com/imRoD.png" rel="nofollow noreferrer">Program runned in Eclipse console</a> </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>package ficheros;
  import java.io.*;
  import java.nio.charset.*;
  import java.util.Scanner;
  public class QuestionCreator {
   public static void main(String[] args) {
    // TODO Auto-generated method stub
    OutputStreamWriter preguntas = null;
    PrintWriter pw = null;
    try(Scanner leer = new Scanner(System.in)){
     // Abrimos el fichero y creamos el BufferedReader para hacer una lectura cómoda
     preguntas = new OutputStreamWriter(new FileOutputStream("preguntas.txt"), Charset.forName("UTF-8"));
     pw = new PrintWriter(preguntas);
     // Preguntamos qué tema quiere seleccionar el usuario
     System.out.println("¿Qué tema quieres? ");
     String tema = leer.nextLine();
     String pregunta, respuesta, trivial;
     boolean salir = false;
     // Hacemos un bucle de creación de preguntas
     while(!salir){
      System.out.println("Si quieres cambiar tema escribe \"Cambiar tema\". Si quieres salir, escribe \"Salir\"");
      System.out.println("Escribe pregunta: ");
      pregunta = leer.nextLine();
      if(pregunta.equals("Cambiar tema") | pregunta.equals("cambiar tema")){
       // En el caso de que el usuario quiera cambiar de tema.
       System.out.println("Escribe tema: ");
       tema = leer.nextLine();
       System.out.println("Escribe pregunta: ");
       pregunta = leer.nextLine();
      } else if(pregunta.equals("Salir") | pregunta.equals("salir")){
       // En el caso de que el usuario quiera salir
       break;
      }
      System.out.println("Escribe respuesta: ");
      respuesta = leer.nextLine();
      // Se crea la pregunta y se introduce en una nueva línea en el documento.
      trivial = "{\"Category\":\"" + tema + "\",\"Question\":\"" + pregunta + "\",\"Answer\":\"" + respuesta + "\"},"; 
      pw.println(trivial);
     }
     } catch(Exception e){
      e.printStackTrace();
     } finally{
      // Cerramos el fichero
      try{
       // Aprovechamos el finally para
       // asegurarnos de que se cierra el fichero
       if(null != pw){
        pw.close();
        System.out.println("PROGRAMA FINALIZADO");
       }
      } catch(Exception e2){
       e2.printStackTrace();
      }
    }
   }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Sorry if my code is in Spanish. It's made for spanish friends. But I don't <strong>REALLY</strong> think my code is the problem, because, how can it work on Eclipse console and not on the .bat / .jar file? I would want to share my program with friends, but it's impossible if the .bat file doesn't print accents to the text file! What <strong>could be the problem</strong>? Why <strong>it doesn't work out of Eclipse</strong>?
   Thank you in advance. ^^</p>