I'm using this to append Unicode text:
Code:
FILE *File = _wfopen( filepath, L"at,ccs=UNICODE" );
This works fine when the Unicode file exists.

However, sometimes the file might not exist, and the Unicode text gets appended without re-creating the
BOM mark at the beginning of the file, which corrupts the file.

Is this how it's suppose to work, or it is a bug?

I don't understand why append mode doesn't just re-create the mark for non-existent files.