Last active
July 1, 2024 07:51
-
-
Save jamesfdickinson/cc91d43b9fb369d6839c1b829a9756fd to your computer and use it in GitHub Desktop.
Convert all files to UTF-8 using powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param ( | |
[Parameter(Mandatory=$True)][String]$SourcePath | |
) | |
Get-ChildItem $SourcePath\* -recurse -Include *.json,*.html,*.xml,*.js,*.txt,*.css | ForEach-Object { | |
$content = $_ | Get-Content | |
Set-Content -PassThru $_.Fullname $content -Encoding UTF8 -Force} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment