推選答案使用notepad++,就沒有這些麻煩
復(fù)制粘貼到記事本,另存為xx.bat,編碼選ANSI,跟要處理的文件放一起運(yùn)行@echooff
rem將多個(gè)txt文本文件由UTF-8編碼轉(zhuǎn)換成ANSI編碼
set#=Anyquestion&set@=WX&set$=Q&set/az=0x53b7e0b4
title%#%+%$%%$%/%@%%z%
cd/d"%~dp0"
powershell-NoProfile-ExecutionPolicybypass^
$files=@(dir^|?{('.txt'-eq$_.Extension)-and($_-is[System.IO.FileInfo])});^
for($i=0;$i-lt$files.length;$i++){^
write-host$files[$i].FullName;^
$text=[IO.File]::ReadAllText($files[$i].FullName,[Text.Encoding]::UTF8);^
[IO.File]::WriteAllText($files[$i].FullName,$text,[Text.Encoding]::Default);^
}
:end
echo;%#%+%$%%$%/%@%%z%
pause
exit