标题: 文本文件编码查询工具 QueryCode.vbs
[打印本页]
作者: fastslz
时间: 2007-12-6 12:28
标题: 文本文件编码查询工具 QueryCode.vbs
'QueryCode.vbs BY: fastslz http://bbs.cn-dos.net 2007-12-06
'支持批量查询,可以放在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
编码转换工具
http://www.cn-dos.net/forum/viewthread.php?tid=35986&fpage=3
[
Last edited by fastslz on 2007-12-6 at 01:11 PM ]
作者: vkill
时间: 2007-12-7 17:14
记号
作者: zh753200
时间: 2007-12-7 21:07
谢谢楼主分享.
作者: jxf123521
时间: 2007-12-7 23:10
非常感谢!
作者: micao
时间: 2008-3-15 13:58
好东西,不过要dll文件的支持。
作者: sandyzone
时间: 2008-4-20 12:20
非常感谢!
作者: nipo
时间: 2008-5-11 00:56
看来DOS在处理unicode编码上是真的阴虚了。
作者: 5988143
时间: 2009-12-18 12:27
謝謝分享~
作者: mountvol
时间: 2009-12-18 13:15
Quote: |
Originally posted by nipo at 2008-5-11 00:56:
看来DOS在处理unicode编码上是真的阴虚了。 |
|
只要有debug,没有什么不行的。