title: java convert csv file encoding from Unicode to UTF-8
body: <p>I have software which exports csv files with Unicode encoding.</p>
  
  <p>When I trying to read those files I get words with white spaces and symbols.</p>
  
  <p>I want to write an automation which will read a csv file with Unicode encoding and convert the file and the date to UTF-8.</p>
  
  <p>I tried several ways I saw in here but it didn't work out.</p>
  
  <p><em>edit - the code</em></p>
  
  <pre><code>    String csvFile = "csv path";
  BufferedReader br = null;
  String line = "";
  String cvsSplitBy = ",";
  
  try {
  
      br = new BufferedReader(new FileReader(csvFile));
      while ((line = br.readLine()) != null) {
  
              // use comma as separator
          String[] country = line.split(cvsSplitBy);
  
      }
  
  } catch (FileNotFoundException e) {
      e.printStackTrace();
  } catch (IOException e) {
      e.printStackTrace();
  } finally {
      if (br != null) {
          try {
              br.close();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>I tried this code and I tried the same code but with the line:</p>
  
  <pre><code>br = new BufferedReader(new InputStreamReader(new FileInputStream(csvFile), StandardCharsets.UTF_8));
  </code></pre>
  
  <p>Thanks!</p>