You're not writing the byte order mark. The editor is probably assuming that the file has an endianness different than your CPU (e.g. your CPU is an x86 and the editor is trying to read the file as a big endian).
I'm not sure what The Standard says about using Unicode character inside source files. Your compiler may be building the array correctly or not. I'm not sure.