Duplicate :
|
Name: bk70084 Date: 06/25/98 "normally", to prepare to read from a file, you can use FileReader fr = new FileReader("nameoffile"); BufferedReader br = new BufferedReader(fr); But if you want to use a different character encoding, you have to do FileInputStream instr = new FileInputStream("nameoffile") InputStreamReader instrR = new InputStreamReader(instr,"ENCODING"); BufferedReader br = new BufferedReader(instrR); Compare this to the "old" way: BufferedInputStream bis = new BufferedInputStream(new InputStream("nameoffile", "ENCODING")); Not only is the new way ugly, it feels like it is less efficient. Please be more considerate of cross-locale coding, and add methods to change the encoding at the FileReader() level. (Review ID: 34240) ======================================================================