Victor said:
Not sure what the heck 'utf8_fopen' is, but in 'fopen' "wt" means
open for Write in Text mode.
No, it's undefined.
From the C draft standard:
7.19.5.3 The fopen function
Synopsis
[#1]
#include <stdio.h>
FILE *fopen(const char * filename,
const char * mode);
[#3] The argument mode points to a string. If the string is
one of the following, the file is open in the indicated
mode. Otherwise, the behavior is undefined.214)
r open text file for reading
w truncate to zero length or create text file for writing
a append; open or create text file for writing at end-of-
file
rb open binary file for reading
wb truncate to zero length or create binary file for
writing
ab append; open or create binary file for writing at end-
of-file
r+ open text file for update (reading and writing)
w+ truncate to zero length or create text file for update
a+ append; open or create text file for update, writing at
end-of-file
r+b or rb+ open binary file for update (reading and writing)
w+b or wb+ truncate to zero length or create binary file for update
a+b or ab+ append; open or create binary file for update, writing
at end-of-file
214If the string begins with one of the above sequences, the
implementation might choose to ignore the remaining
characters, or it might use them to select different
kinds of a file (some of which might not conform to the
properties in 7.19.2).
Brian