in reply to Re^2: How to write a utf-8 file
in thread How to write a utf-8 file
As ikegami posted above, your code is correct.
Try it with a different input file and open the output file with a different text editor.
Occasionally, Notepad++ fails to show unicode charters for me even when the file itself is OK. Close and reopen usually fixes it.