fi = open("myfile.txt", "r", encoding="windows-1252"); fo = open("output.txt", "w", "utf-8"); fo.write(fi.read()); => Reader fi = new InputStreamReader(new FileInputStream("myfile.txt"), "windows-1252")); Writer fo = new OutputStreamWriter(new FileOutputStram("output.txt"), "utf-8")); fo.write(fi.read()); // well, not exactly this syntax, but...