Borland C++ Builder 6 and reading Unicode (chinese characters) from a text file. Reads a blank. Something I'm doing wrong?
Posted on 2003-11-13
Hi, I'm using Borland C++ Builder 6. I am trying to read a text file which contains Unicode characters (chinese characters specifically). I think the code I've come up with should work, except that when I run it, the "getline" that's in the loop only runs once and the messagebox displays a blank. I'm new to to unicode and widechars. is there something I am doing wrong?
My code is below:
Application->MessageBox("Sorry, Can't open file","Error!",MB_OK);
// loop while not at the end of file
// read a line from the file
//Display the read line in a messagebox
MessageBoxW(NULL, buff.data(), L"Output",MB_OK);
// close the file