CArchive
is not intended to read common text files. It is used to save and store a binary representation of the data used by your application (commonly the data hold by your
CDocument
class).
If you use the
CArchive
string functions, they will use Unicode strings with Unicode builds and multi byte strings with non Unicode builds.
If you want to read common text files, use any other file I/O method like
CFile
, streams, or the C standard library
f
functions to read the text as is (binary) into a buffer and convert aftwerwards if necessary (e.g. convert ANSI text to Unicode to be displayed with Unicode applications). See
Handling simple text files in C/C++[
^] for converting text to other encodings.