Ignore:
Timestamp:
12/13/11 16:51:46 (13 years ago)
Author:
sherbold
Message:
  • now specifies character encoding of file explicitly instead of assuming default encoding
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaHelperLib/src/de/ugoe/cs/util/FileTools.java

    r175 r310  
    22 
    33import java.io.File; 
     4import java.io.FileInputStream; 
    45import java.io.FileNotFoundException; 
    56import java.io.FileReader; 
    67import java.io.IOException; 
     8import java.io.InputStreamReader; 
     9import java.nio.charset.Charset; 
    710 
    811/** 
     
    5558                        boolean carriageReturn) throws IOException, FileNotFoundException { 
    5659                File f = new File(filename); 
    57                 FileReader reader = new FileReader(f); 
     60                FileInputStream fis = new FileInputStream(f); 
     61                InputStreamReader reader = new InputStreamReader(fis, 
     62                                Charset.defaultCharset()); 
    5863                char[] buffer = new char[(int) f.length()]; 
    5964                reader.read(buffer); 
Note: See TracChangeset for help on using the changeset viewer.