-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconvert_to_utf8.ps1
More file actions
34 lines (34 loc) · 1.19 KB
/
convert_to_utf8.ps1
File metadata and controls
34 lines (34 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function ConvertTo-UTF8 {
param(
[string]$path = $pwd,
[bool]$recurse = $false
)
if ($recurse) {
foreach($i in Get-ChildItem -Recurse -Path $path -Filter "*.cpp") {
$temp = Get-Content $i.fullname
Out-File -filepath $i.fullname -inputobject $temp -encoding utf8 -force
}
foreach($i in Get-ChildItem -Recurse -Path $path -Filter "*.h") {
$temp = Get-Content $i.fullname
Out-File -filepath $i.fullname -inputobject $temp -encoding utf8 -force
}
} else {
foreach($i in Get-ChildItem -Path $path -Filter "*.cpp") {
$temp = Get-Content $i.fullname
Out-File -filepath $i.fullname -inputobject $temp -encoding utf8 -force
}
foreach($i in Get-ChildItem -Path $path -Filter "*.h") {
$temp = Get-Content $i.fullname
Out-File -filepath $i.fullname -inputobject $temp -encoding utf8 -force
}
}
}
ConvertTo-UTF8
ConvertTo-UTF8 "ASM_GCC"
ConvertTo-UTF8 "ASM_MSVC"
ConvertTo-UTF8 "PlayGround"
ConvertTo-UTF8 "Linux" $true
ConvertTo-UTF8 "Windows" $true
ConvertTo-UTF8 "XNative" $true
ConvertTo-UTF8 "Tests"
ConvertTo-UTF8 "Benchmark"