There are four kind of encoding options when creating a .txt file in Windows.
- ANSI
- UNICODE(litte endian)
- UNICODE(big endian)
- UTF-8
C standard library supports this option, by using FILE
.
FILE* file;
file = _wfopen(L"test.txt", L"wt+,ccs=UTF-16LE");
It has been working great, but I found there is no parameter for this in std::ofstream
.
wofstream myfile;
myfile.open("example.txt", ?????????);
So, I want to know how to create files like this in C++. Is there any solution for this in C++ STL?