推选答案使用notepad++,就没有这些麻烦
复制粘贴到记事本,另存为xx.bat,编码选ANSI,跟要处理的文件放一起运行@echooff
rem将多个txt文本文件由UTF-8编码转换成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