-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConvert-OemToUtf8.ps1
More file actions
28 lines (24 loc) · 974 Bytes
/
Convert-OemToUtf8.ps1
File metadata and controls
28 lines (24 loc) · 974 Bytes
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
function Convert-OemToUtf8 {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]$inputString
)
$convertedString = [System.Text.StringBuilder]::new()
foreach ($char in $inputString.ToCharArray()) {
switch ([int][char]$char) {
129 {
$convertedString = $convertedString.Append('ü')
}
132 { $convertedString = $convertedString.Append('ä') }
142 { $convertedString = $convertedString.Append('Ä') }
148 { $convertedString = $convertedString.Append('ö') }
153 { $convertedString = $convertedString.Append('Ö') }
154 { $convertedString = $convertedString.Append('Ü') }
225 { $convertedString = $convertedString.Append('ß') }
default { $convertedString = $convertedString.Append($char) }
}
}
return $convertedString.ToString()
# Test: $a = Convert-OemToUtf8 'Rckfahrt'
}