Writing to a file in Unicode

Posted by Lefteris on Stack Overflow See other posts from Stack Overflow or by Lefteris
Published on 2010-03-11T17:46:40Z Indexed on 2010/03/11 18:09 UTC
Read the original article Hit count: 154

Filed under:
|

I am having some problems writing to a file in unicode inside my c program. I am trying to write a unicode Japanese string to a file. When I go to check the file though it is empty. If I try a non-unicode string it works just fine. What am I doing wrong?

setlocale(LC_CTYPE, "");
FILE* f;
f = _wfopen(COMMON_FILE_PATH,L"w");
fwprintf(f,L"???");
fclose(f);

Oh about my system: I am running Windows. And my IDE is Visual Studio 2008.

© Stack Overflow or respective owner

Related posts about c

    Related posts about unicode