I'm reading a UTF-16 formatted file with fread bytewise and want to store the result into a std::wstring. So far i'm able to read the file with:
char* path = "Some_Path_To_a_UTF-16_File" char buffer[buffersize]; FILE* handle = fopen(path, "rb"); fread(buffer, 1, 100, handle); After this I have (some of) the bytes of the file stored in buffer (including BOM).
Now to my actual question: I want to store the data I've just read into a std::wstring! I don't know/understand how i can get those respectively 2 bytes representing a UTF-16 character into a wstring?
I can't use any external librarys! Thanks for your help in advance!
std::wstring. Do you also need to decode the UTF-16 stream? That's easily searchable too.