参考链接:http://blog.csdn.net/dengta_snowwhite/article/details/6418384
方法:
public static String readFile(String filePath) {
StringBuilder sb = new StringBuilder();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), "GB2312"));
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(EncodingUtils.getString(line.getBytes("utf-8"), "utf-8"));
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return sb.toString();
}