>> No, you must specify the encoding when using fopen with UTF strings.
Not if you already have a UTF8 string that you want to write. When you use "css=", you can only use wide stream functions: fwprintf, fputws, etc... Then the CRT takes care of the BOM and UTF16LE -> UTFx conversions for you.

It's a nice convenience that the MS-CRT provides - which the Op could have utilized.

Other issues with the code:
- void main()
- implementation defined behavior due to non-basic character literals
- sending a non-basic / non-LC_CTYPE encoded string through fputs()

gg