Question: how to utf-8 encode a file?
Answer: Open the file with TextEdit.
Navigate to Format > Make Plain Text. A screenshot of the menu is as shown below: ... 
Next, navigate to File > Save. It is shown as below: ... 
From the Plain Text Encoding drop-down list, select Unicode(UTF-8).
Finally, click Save to save the file.