A
Ali
I would like to write a program that can handle non-ANSI characters.
The following code does not work, the output is empty:
#include <fstream>
#include <string>
using namespace std;
int main() {
wofstream out(L"log");
if (!out)
exit(127);
wstring s(L"õûíÕÛÍ");
out << s << endl;
out.close();
return 0;
}
The log file is in ANSI char encoding, and probably that is why the
output fails.
Could anyone help me how to do this?
Many thanks.
The following code does not work, the output is empty:
#include <fstream>
#include <string>
using namespace std;
int main() {
wofstream out(L"log");
if (!out)
exit(127);
wstring s(L"õûíÕÛÍ");
out << s << endl;
out.close();
return 0;
}
The log file is in ANSI char encoding, and probably that is why the
output fails.
Could anyone help me how to do this?
Many thanks.