PowerShell - Convert a text file's encoding to UTF-8
This process converts a text file that has been encoded with unreadable characters and creates a new UTF-8 encoded file using PowerShell.
In this example, the input file (MessedUpEncoding.txt) has been encoded with MS-DOS Greek encoding. The result is a new UTF-8 encoded file (ConvertedToUTF-8.txt), and the entire text is passed into a DataTable variable that can be used for further processing.
The text file before and after the conversion can be seen in the image below: