最代码官方
2012-08-14 22:34:13
原证
java自动根据文件内容的编码来读取避免乱码
通过cpdetector这个开源的jar包可以自动判断当前文件的内容编码,从而在读取的时候选择正确的编码读取,避免乱码问题。
测试结果,提供截图:
GBK文件内容
UTF8文件内容
运行结果:
由Wood编辑于2013-12-19 9:21:44
猜你喜欢
请下载代码后再发表评论
文件名:filedetectcharset.zip,文件大小:464K
下载
- /
- /filedetectcharset
- /filedetectcharset/.classpath
- /filedetectcharset/.project
- /filedetectcharset/lib
- /filedetectcharset/lib/antlr-2.7.4.jar
- /filedetectcharset/lib/chardet-1.0.jar
- /filedetectcharset/lib/cpdetector_1.0.10.jar
- /filedetectcharset/lib/jargs-1.0.jar
- /filedetectcharset/src
- /filedetectcharset/src/com
- /filedetectcharset/src/com/javaniu
- /filedetectcharset/src/com/javaniu/test
- /filedetectcharset/src/com/javaniu
- /filedetectcharset/src/com
- /filedetectcharset
![最代码相关代码源代码列表](https://static.zuidaima.com/resource/img/heart_ico.png)
![最代码最近下载分享源代码列表](https://static.zuidaima.com/resource/img/heart_ico.png)
1358849392 LV21
2023年7月4日
神鼎飞丹砂 LV11
2022年4月18日
894529070
2022年1月5日
暂无贡献等级
w73614847 LV6
2021年8月23日
2469095052 LV8
2021年2月2日
aixiao1 LV1
2020年8月7日
hbs2019 LV9
2019年4月23日
oldfox LV18
2019年3月23日
han891120 LV1
2019年1月29日
WinnieYYY LV1
2018年12月25日