Using Windows PowerShell to “normalise” a text string

Long story, but I  needed a way to normalise a text string.  Say this:

$txt = "Correo electrónico del usuario"

and I found this:

[Text.Encoding]::ASCII.GetString([Text.Encoding]::GetEncoding(1251).GetBytes($txt))

and the result is:

Correo electronico del usuario

Awesome, job done!

Leave a Reply

%d bloggers like this: