当前位置: 移动技术网 > IT编程>脚本编程>VBScript > QueryCode.vbs 文本文件编码查询工具

QueryCode.vbs 文本文件编码查询工具

2017年12月08日  | 移动技术网IT编程  | 我要评论

程亚丽最新消息,维基解密黄菊自杀,朝鲜中央电视台直播

只要下载此文件后便可以查询了.
下面是详细代码
复制代码 代码如下:

'querycode.vbs by: fastslz
'支持批量查询,可以放在sendto扩展应用
set files=wscript.arguments
if files.count=0 then
msgbox "请将要查询的文件拖动到这个文件里! ", vbinformation, "文件编码查询工具 by: fastslz"
end if
for i=0 to files.count-1
file=files(i)
call checkcode ("   编码为:")
next
function checkcode (usage)
dim slz
set slz = createobject("adodb.stream")
slz.type = 1
slz.mode = 3
slz.open
slz.position = 0
slz.loadfromfile file
bin=slz.read(2)
if ascb(midb(bin,1,1))=&hef and ascb(midb(bin,2,1))=&hbb then
codes="utf-8"
elseif ascb(midb(bin,1,1))=&hff and ascb(midb(bin,2,1))=&hfe then
codes="unicode"
else
codes="gb2312"
end if
wscript.echo file,usage,codes
slz.close
set slz = nothing
end function

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网