Resource resource =new ClassPathResource("dictionary.txt"); BufferedReader reader=null; //reader=new BufferedReader(new FileReader(file));这样在web运行的时候,读取会乱码 reader=new BufferedReader(new InputStreamReader(resource.getInputStream(),"UTF-8"));
原文地址:https://www.cnblogs.com/lyon91/p/10155991.html
时间: 2024-10-27 11:11:48