Skip to content

Instantly share code, notes, and snippets.

@Elnee
Created July 30, 2019 12:38
Show Gist options
  • Select an option

  • Save Elnee/cd3d113b44c6aa7b131f81b717dd8d77 to your computer and use it in GitHub Desktop.

Select an option

Save Elnee/cd3d113b44c6aa7b131f81b717dd8d77 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment