Elnee
7/30/2019 - 12:38 PM

PowerShell script for convert all cpp and h files in your folder to utf8

PowerShell script for convert all cpp and h files in your folder to utf8

Set-Location -Path D:\Projects\SomeProject # Path to your sources
foreach ($file in Get-ChildItem)
{
    if ($file -like "*.cpp" -or $file -like "*.h") {
        Write-Host "Processing " -ForegroundColor Red -NoNewline
        Write-Host $file
        Set-Content -Encoding UTF8 -Path $file -Value (Get-Content $file)
    }
}
Write-Host "All files has been recoded" -ForegroundColor Green