InputStreamReader的编码

InputStreamReader的编码 - simmone - BlogJava

simmone

 

InputStreamReader的编码

问题:
    从Zip文件中读数据,中间使用了InputStreamReader,读入的内容写入数据库
中,结果发现数据库中显示为乱码。

解决:
    一开始陷入误区,以为是数据库的编码问题,搞了一天(相当痛苦,疲惫,怀疑,失去自信,不想干了...)。最后终于排查到读文件的InputStreamReader,从InputStreamReader(Inputstream)改为InputStreamReader(Inputstream, "GBK")就对了。
   唉, 程序员的苦与乐...。

原文地址:https://www.cnblogs.com/lexus/p/2797422.html