forked from telecomadm1145/CasioEmuMsvc
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGB2UTF8.ps1
More file actions
22 lines (22 loc) · 681 Bytes
/
Copy pathGB2UTF8.ps1
File metadata and controls
22 lines (22 loc) · 681 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function convertUTF8()
{
param($Path);
if (-not [System.IO.File]::Exists($Path))
{
throw [System.IO.FileNotFoundException]::new();
}
[System.IO.File]::WriteAllText($path,[System.IO.File]::ReadAllText($Path,[System.Text.Encoding]::Default),[System.Text.Encoding]::UTF8);
}
function ConvertAll-UTF8()
{
param($Pattern)
$files = [System.IO.Directory]::EnumerateFiles([System.Environment]::CurrentDirectory,$Pattern,[System.IO.SearchOption]::AllDirectories)
foreach ($file in $files)
{
convertUTF8 -Path $file
Write-Host "fucked " + $file
}
}
ConvertAll-UTF8 -Pattern *.h
ConvertAll-UTF8 -Pattern *.hpp
ConvertAll-UTF8 -Pattern *.cpp