title: How can I convert UTF-8 literals, into its UTF-8 character?
body: <p>I have a bunch of text files that were encoded in <code>UTF-8</code>. The text inside the files look like this: <code>\x6c\x69b/\x62\x2f\x6d\x69nd/m\x61x\x2e\x70h\x70</code>.</p>
  
  <p>I've copied all these text files and placed them into a directory <code>/convert/</code>.</p>
  
  <p>I need to read each file and convert the encoded literals into characters, then save the file. <code>filename.converted.txt</code></p>
  
  <p>What would be the smartest approach to do this? What can I do to convert to the new text? Is there a function for handling Unicode text to convert between the literal to character types? Should I be using a different programming language for this?</p>
  
  <p>This is what I have at the moment:</p>
  
  <pre><code>import java.io.BufferedWriter;
  import java.io.File;
  import java.io.FileWriter;
  
  public class decode {
      public static void main(String args[]) {
          File directory = new File("C:/convert/");
          String[] files = directory.list();
          boolean success = false;
          for (String file : files) {
              System.out.println("Processing \"" + file + "\"");
  
              //TODO read each file and convert them into characters
              success = true;
  
              if (success) {
                  System.out.println("Successfully converted \"" + file + "\"");
              } else {
                  System.out.println("Failed to convert \"" + file + "\"");
              }
  
              //save file
              if (success) {
                  try {
                      FileWriter open = new FileWriter("C:/convert/" + file + ".converted.txt");
                      BufferedWriter write = new BufferedWriter(open);
                      write.write("TODO: write converted text into file");
                      write.close();
                      System.out.println("Successfully saved \"" + file + "\" conversion.");
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          }
      }
  }
  </code></pre>