How to write a UTF-8 file
Hi everyone.
I'm working on this for a whole day, but still couldn't find the answer. This is my problem:
1. I need to write a UTF-8 config file with nsis.
2. I'm using NSIS Unicode.
3. I've tried this code:
FileOpen $0 $EXEDIR\CONFIG.PATH w
FileWrite $0 $EXEDIR
FileClose $0
This create a ANSI file.
4. I've tried FileWriteUTF16LE. It create a UTF-16LE file.
5. Finally I found a solution: Write a ANSI file. Then use the Unicode plugin to convent that file to UTF-8. But that is a ansi plugin, it's a bit complex to use in NSIS Unicode. So I don't think that is a good idea.
Could someone tell me how to directly write a UTF-8 file in NSIS? Use WinAPI or something?
Great appreciate.
David Pi