@Test public void testConvertEncoding() throws IOException { String path = dirPath + "/" + "AsciiFile.txt"; BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), StandardCharsets.ISO_8859_1)); out.write("This is a test String"); out.flush(); out.close(); String outPutFile = dirPath + "/" + "UTF8File.txt"; FileUtil.convertToUtf8(path, outPutFile, "UTF-8"); InputStream is = getClass().getResourceAsStream("UTF8File.txt"); InputStreamReader isr = new InputStreamReader(is); assertNotNull(isr); assertEquals("UTF8", isr.getEncoding()); }
public static void convertEncoding(String inputFile, String outputFile, String actualCharset, String desiredCharset) { convertEncoding(new File(inputFile), new File(outputFile), actualCharset, desiredCharset); }
FileUtil { public static void convertEncoding(String inputFile, String outputFile, String actualCharset, String desiredCharset) { convertEncoding(new File(inputFile), new File(outputFile), actualCharset, desiredCharset); } }
FileUtil { public static void convertEncoding(String inputFile, String outputFile, String actualCharset, String desiredCharset) { convertEncoding(new File(inputFile), new File(outputFile), actualCharset, desiredCharset); }  }
FileUtil { public static void convertEncoding(String inputFile, String outputFile, String actualCharset, String desiredCharset) { convertEncoding(new File(inputFile), new File(outputFile), actualCharset, desiredCharset); }  static File newFile(File directory, String fileName); static InputStream newFileInputStream(File directory, String fileName); static InputStream newFileInputStream(File file); static boolean containsFile(File directory, String fileName); static boolean containsSubdirectory(File directory, String subdirName); static File[] getSubdirectories(File directory); static void convertToUtf8(String inputFile, String outputFile, String actualCharset); static void convertToUtf8(File in, File out, String actualCharset); static void convertEncoding(String inputFile, String outputFile, String actualCharset,
			String desiredCharset); @Deprecated static void convertEncoding_old(File in, File out, String actualCharset,
			String desiredCharset); static void convertEncoding(File in, File out, String actualCharset,
			String desiredCharset); static String getContents(String path); static String getContents(String path, String charset); static byte[] getByteContents(String path); static String getContents(File file); static String getContents(File file, String charset); static String getContents(InputStream is); static String getContents(URL url, String charset); static void setContents(String path, String contents); static void setContents(String path, String contents, String charset); static void setContents(String path, byte[] contents); static void setContents(File file, String contents); static void setContents(File file, String contents, String charset); static void setContents(File file, InputStream contents); static void setContents(File file, InputStream contents, int bufsize); static void setContents(File file, byte[] contents); static void addContent(String path, String contents); static void addContent(String path, String contents, String charset); static void addContent(File file, String content); static void addContent(File file, String content, String charset); static void addContent(File file, InputStream contents, int bufsize); static void addContent(File file, byte[] content); static void setContents(File file, InputStream contents, int bufsize, boolean append); static void log(String message, Object... messageArgs); static void log(File file, String message, Object... messageArgs); static void delete(String path); }
FileUtil { public static void convertEncoding(String inputFile, String outputFile, String actualCharset, String desiredCharset) { convertEncoding(new File(inputFile), new File(outputFile), actualCharset, desiredCharset); }  static File newFile(File directory, String fileName); static InputStream newFileInputStream(File directory, String fileName); static InputStream newFileInputStream(File file); static boolean containsFile(File directory, String fileName); static boolean containsSubdirectory(File directory, String subdirName); static File[] getSubdirectories(File directory); static void convertToUtf8(String inputFile, String outputFile, String actualCharset); static void convertToUtf8(File in, File out, String actualCharset); static void convertEncoding(String inputFile, String outputFile, String actualCharset,
			String desiredCharset); @Deprecated static void convertEncoding_old(File in, File out, String actualCharset,
			String desiredCharset); static void convertEncoding(File in, File out, String actualCharset,
			String desiredCharset); static String getContents(String path); static String getContents(String path, String charset); static byte[] getByteContents(String path); static String getContents(File file); static String getContents(File file, String charset); static String getContents(InputStream is); static String getContents(URL url, String charset); static void setContents(String path, String contents); static void setContents(String path, String contents, String charset); static void setContents(String path, byte[] contents); static void setContents(File file, String contents); static void setContents(File file, String contents, String charset); static void setContents(File file, InputStream contents); static void setContents(File file, InputStream contents, int bufsize); static void setContents(File file, byte[] contents); static void addContent(String path, String contents); static void addContent(String path, String contents, String charset); static void addContent(File file, String content); static void addContent(File file, String content, String charset); static void addContent(File file, InputStream contents, int bufsize); static void addContent(File file, byte[] content); static void setContents(File file, InputStream contents, int bufsize, boolean append); static void log(String message, Object... messageArgs); static void log(File file, String message, Object... messageArgs); static void delete(String path);  }