I'm a newbie in WinApi programming. I'm creating a file mapping program. A user enters some string to the input and this text has to be put into a file. But in the file I get strange white spaces between each symbol. For instance, if I enter "Some text", I get "S o m e t e x t". Why is it?
pBuf = (LPTSTR)MapViewOfFile(fileMap, FILE_MAP_ALL_ACCESS, 0, 0, 10240000);
...
GetWindowText(teacherInput, teacher, 31);
memcpy((PVOID)pBuf, teacher, 31 * charSize);
As Raymond Chen stated in the comments, this happend because the encodings don't match.