@echo off
REM 来自网络修改
powershell.exe -command "dir *.c -R|foreach-object{[void][System.IO.File]::WriteAllBytes($_.FullName,[System.Text.Encoding]::Convert([System.Text.Encoding]::GetEncoding('GB2312'),[System.Text.Encoding]::UTF8,[System.IO.File]::ReadAllBytes($_.FullName)))};Write-Host '转换完成...'"
powershell.exe -command "dir *.h -R|foreach-object{[void][System.IO.File]::WriteAllBytes($_.FullName,[System.Text.Encoding]::Convert([System.Text.Encoding]::GetEncoding('GB2312'),[System.Text.Encoding]::UTF8,[System.IO.File]::ReadAllBytes($_.FullName)))};Write-Host '转换完成...'"
del bat.bat
pause
文件夹子目录下c和h文件批量转换为UTF8
于 2021-09-11 18:54:13 首次发布