Create a file utf8.txt
. Ensure the encoding is UTF-8 (no BOM). Set its content to €
In cmd.exe
:
type utf8.txt > o
For PowerShell 5.1, enable this setting:
Control Panel, Region, Administrative, Change system locale, Use Unicode UTF-8 for worldwide language support
Then enter this into PowerShell:
$PSDefaultParameterValues['*:Encoding'] = 'Default'
Alternatively, you can upgrade to PowerShell 6 or higher.
https://github.com/PowerShell/PowerShell