c++ WriteFile unicode characters
问题 I'm trying to write a wstring into a UTF-8 file using WriteFile function. I want the file to have these characters "ÑÁ" but I'm getting this "�". Here is the code #include <iostream> #include <cstdlib> #include <sstream> #include <string> #include <fstream> #include <windows.h> #include <wchar.h> #include <stdio.h> #include <winbase.h> using namespace std; const char filepath [] = "unicode.txt"; int main () { wstring str; str.append(L"ÑÁ"); wchar_t* wfilepath; // Create a file to work with