12

For some reasons, I need to write files that have Chinese characters in the filenames(C language). For example:

#include<stdio.h>
#include<stdlib.h>
FILE *fout;
int main(){
    fout = fopen("乔布斯.txt", "w");
    fprintf(fout, "Jobs");
    //Do something...
}

No errors, however, no file was created. I want to know how to solve the problem. Thanks!
OS is windows 8.1, though a Linux solving can be accepted.

Jeffchan
  • 121
  • 7
  • Can't you just rename the file? – JordyvD Jan 26 '16 at 09:29
  • @g3mini OP clearly states that it is required to save files with Chinese characters in the filename. Also, renaming the files would be tedious and reduce accuracy, both for linguistic reasons. – Arc676 Jan 26 '16 at 09:31
  • It seems to work on GCC/Linux (now how do I delete the file;)?). Note though that how the filename is mapped to an actual file is implementation defined (IIRC). – skyking Jan 26 '16 at 09:32
  • Windows 8.1. I am sorry, I have to use Chinese filenames. Because there are lots of files and users are all Chinese. – Jeffchan Jan 26 '16 at 09:37
  • 1
    @Jeffchan Cody Gray has already answered you. – mikedu95 Jan 26 '16 at 09:41
  • 1
    Thank you all! Maybe I get the problem solved. Sorry for duplicating the problem, because I can't understand the origin problem's solving before. Anyway, thank you very much! – Jeffchan Jan 26 '16 at 09:46

0 Answers0