使用FileReader读取文件出现中文乱码

时间:2024-04-02 14:01:27

@条条

使用FileReader读取文件出现中文乱码

使用FileReader读取文件出现中文乱码 代码是没有错误的

但是运行之后发现文档中的中文变成乱码使用FileReader读取文件出现中文乱码

奇了个怪了

于是乎我查看了文档的编码格式

使用FileReader读取文件出现中文乱码utf-8,也没有错呀
解决方法:
进eclipse>windows>preferences>general>workplace>text file encoding>将编码格式改成其他:utf-8即可
使用FileReader读取文件出现中文乱码

最终结果:

使用FileReader读取文件出现中文乱码