I am wondering what is causing this strange output from simply reading a text file using ifstream. I can save a file with my text editor, and Notepad will open it correctly, my text editor, on the other hand, opens the text file along with weird unicode characters. (e.g. these images:)
The text editor on the left, Notepad, has no issues opening a text file. The text editor on the right, my text editor, seems to have appended a weird unicode character.
I am wondering if fstream is the issue, or perhaps my openTextFile() method is buggy. I am not exactly sure why this is happening, I suspect it could be just my values within my code. Here is the mentioned code below (by the way, I am using the Win32 API):
This code is within the openTextFile() method.
char buffer[1024];
int count = 0;
ifstream file("path",ifstream::in);
while(file.good()){
buffer[count]=file.get();
count+=1;
}
file.close();
Feedback would be very appreciated. Thanks.
-CA1K