需要在读取的时候改变一下编码方式,我看网上有很多说填utf-8就可以解决,但是我在尝试的时候并不行,而使用GB2312可以
public Map parseJson(String filepath) throws IOException {BufferedReader reader = null;String laststr = "";FileInputStream fileInputStream = new FileInputStream(filepath);InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "GB2312");reader = new BufferedReader(inputStreamReader);String tempString = null;while ((tempString = reader.readLine()) != null) {laststr += tempString;}reader.close();Map maps = (Map) JSON.parse(laststr);return maps;}