找回密码
 立即注册
搜索
查看: 1991|回复: 16

用啥工具能最快的改变txt的编码

[复制链接]
头像被屏蔽
     
发表于 2010-1-19 14:02 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

     
发表于 2010-1-19 14:06 | 显示全部楼层
Convert Z
回复

使用道具 举报

     
发表于 2010-1-19 14:13 | 显示全部楼层
vim / Emeditor
回复

使用道具 举报

发表于 2010-1-19 14:18 | 显示全部楼层
CueCode + Convert Z
回复

使用道具 举报

     
发表于 2010-1-19 14:49 | 显示全部楼层
IE
回复

使用道具 举报

发表于 2010-1-19 15:17 | 显示全部楼层
文件名:编码转换.vbs

on error resume next
Set WshShell=WScript.CreateObject(\"Shell.Application\")
dirPath=WshShell.BrowseForFolder(0, \"请选择路径\", 0, \"\").items().item().path
if right(dirPath,1)<>\"\\\" then dirPath=dirpath&\"\\\"
ma=inputbox(\"请输入要转换为的编码\",\"\",\"utf-8\")
if ma=\"\" or dirPath=\"\\\" or msgbox(\"在使用前请确认已备份文件夹\"&dirPath,1)=2 then WScript.Quit

\'遍历文件夹下的文件
Set FSO = CreateObject(\"scripting.filesystemobject\")
Set f = FSO.GetFolder(dirPath)
Set fs = f.files
For Each fileN in fs
FN=dirPath&fileN.name&\"\"
if \".txt\"=lcase(right(FN,4)) then Call WriteToFile(FN, ReadFile(FN, CheckCode(FN)), ma)
Next
Set FSO = Nothing
wscript.echo \"全部成功\"

\'检测文件的编码
Function CheckCode (FileUrl)
Dim slz
set slz = CreateObject(\"Adodb.Stream\")
slz.Type = 1
slz.Mode = 3
slz.Open
slz.Position = 0
slz.Loadfromfile FileUrl
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
slz.Close
set slz = Nothing
CheckCode=Codes
End Function

\'以指定的编码读取文件
Function ReadFile(FileUrl, CharSet)
On Error Resume Next
Dim Str
Set stm = CreateObject(\"Adodb.Stream\")
stm.Type = 2
stm.mode = 3
stm.charset = CharSet
stm.Open
stm.loadfromfile FileUrl
Str = stm.readtext
stm.Close
Set stm = Nothing
wscript.echo Str
ReadFile = Str
End Function

\'以指定的编码写文件
Function WriteToFile (FileUrl, Str, CharSet)
On Error Resume Next
Set stm = CreateObject(\"Adodb.Stream\")
stm.Type = 2
stm.mode = 3
stm.charset = CharSet
stm.Open
stm.WriteText Str
stm.SaveToFile FileUrl, 2
stm.flush
stm.Close
Set stm = Nothing
End Function

试了下这玩意好像还行
回复

使用道具 举报

发表于 2010-1-19 17:10 | 显示全部楼层
澄空那有个自制的小软件ruby什么的
好像还有个蓝宝石吧
用过几次,不错
回复

使用道具 举报

发表于 2010-1-19 17:42 | 显示全部楼层
回复

使用道具 举报

     
发表于 2010-1-19 17:52 | 显示全部楼层
MadEdit
回复

使用道具 举报

发表于 2010-1-19 18:51 | 显示全部楼层
notepad2
回复

使用道具 举报

发表于 2010-1-20 03:31 | 显示全部楼层
textwrangler
回复

使用道具 举报

发表于 2010-1-20 03:45 | 显示全部楼层
五花八门
回复

使用道具 举报

     
发表于 2010-1-20 07:46 | 显示全部楼层
之前经常用南极星自带的转码工具。
回复

使用道具 举报

发表于 2010-1-20 08:06 | 显示全部楼层
超级批量编码转换

最快,沒有之一
回复

使用道具 举报

     
发表于 2010-1-20 15:11 | 显示全部楼层
二连,悲剧
回复

使用道具 举报

     
发表于 2010-1-20 15:11 | 显示全部楼层
textforever,写comicviewer的老马写的,还带很多其他实用功能,非常好用
回复

使用道具 举报

     
发表于 2010-1-20 15:34 | 显示全部楼层
Convert Z很好用,就是UI做得很另类,win7下有些兼容性问题
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|上海互联网违法和不良信息举报中心|网上有害信息举报专区|962110 反电信诈骗|举报电话 021-62035905|Stage1st ( 沪ICP备13020230号-1|沪公网安备 31010702007642号 )

GMT+8, 2025-9-19 01:34 , Processed in 0.128050 second(s), 7 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表