'Comparision of an umlaut with literal fails

I have a text file which contains the single letter (german umlaut) Ä:

Text file in Hex-Editor showing only the character Ä as 0xC4

I'm reading this file in a script.

$content = Get-Content -Path 'C:\Temp\Test.txt' -Encoding 1252

When I write $content to the console, the Ä is displayed correctly. But when I'm doing a comparison with a literal it yields a wrong result.

if ($content -eq 'Ä')
{
    "Match"
}
else
{
    "No match"
}

Why does this print No match?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source