首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

String编码(5) 文件编码检测

2013-03-29 
String编码(五) 文件编码检测1.2)测试在D:/FileReaderTest中创建文件fileReaderTest-GBK.txtfileReaderTes

String编码(五) 文件编码检测

1.2)测试

在D:/FileReaderTest中创建文件

fileReaderTest-GBK.txt

fileReaderTest-Unicode.txt

fileReaderTest-UnicodeBE.txt

fileReaderTest-UTF8.txt

GBK.txt

Unicode.txt

UTF8.txt

文件编码格式如文明名所示,fileReaderTest*.txt由windows创建,其余三个由eclipse创建。

程序运行结果

?1.3)测试

运行FileEncodingDetectorTest.java,结果如下

Encoding type of fileReaderTest-GBK.txt is GB2312Encoding type of fileReaderTest-Unicode.txt is UTF-16LEEncoding type of fileReaderTest-UnicodeBE.txt is UTF-16BEEncoding type of fileReaderTest-UTF8.txt is UTF-8Encoding type of GBK.txt is GB2312Encoding type of Unicode.txt is UTF-16BEEncoding type of UTF8.txt is UTF-8

?1.4)参考资料

http://cpdetector.sourceforge.net/

热点排行