Java tutorial
import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { // new input stream reader is created FileInputStream fis = new FileInputStream("C:/test.txt"); InputStreamReader isr = new InputStreamReader(fis); // the name of the character encoding returned String s = isr.getEncoding(); System.out.print("Character Encoding: " + s); isr.close(); } }