如果文件或流有中文 ,如果用Scanner构造函数Scanner(File source) 则对File的扫描结果为空 ,调用 booleanhasNext() 方法会永远返回false ;如果是 Scanner(InputStream source) 中文会乱码; 处理的方法为:用构造函数Scanner(File source, String charsetName) ,或Scanner(InputStream source, String charsetName) 对中文进行编码("UTF-8")。