Hi there,
I'm trying to read from a unicode file. The contents of the file is the word "hello" followed by a tab and then a schwa (unicode character that looks like an upside-down e)
It is saved in unicode, and it has the BOM 0xFF 0xFE at the start.
Now I do the following in my program:
#ifdef _UNICODE
CStdioFile c;
c.Open("hello.txt", CFile::modeRead | CFile::typeBinary);
CString stuff;
c.ReadString(stuff);
c.Close();
#endif
The string that ends up in stuff looks like this in the debugger:
"?hello ?"
If I put it in a CStatic or CEdit the ?s are replaced by squares.
The first ? is the BOM, the second is the schwa.
So what's going on there? Why is the BOM making it into my string and why are non-ansi characters appearing as ?s?
Thank you.
I'm trying to read from a unicode file. The contents of the file is the word "hello" followed by a tab and then a schwa (unicode character that looks like an upside-down e)
It is saved in unicode, and it has the BOM 0xFF 0xFE at the start.
Now I do the following in my program:
#ifdef _UNICODE
CStdioFile c;
c.Open("hello.txt", CFile::modeRead | CFile::typeBinary);
CString stuff;
c.ReadString(stuff);
c.Close();
#endif
The string that ends up in stuff looks like this in the debugger:
"?hello ?"
If I put it in a CStatic or CEdit the ?s are replaced by squares.
The first ? is the BOM, the second is the schwa.
So what's going on there? Why is the BOM making it into my string and why are non-ansi characters appearing as ?s?
Thank you.