Whenever I encounter a substitute character http://en.wikipedia.org/wiki/Substitute_character while reading a file in C++ using getline(), it is interpreted as a EOF so I cannot advance with my reading in order to get the file entire content. So my question is, how can I skip the substitute characters and read the content of the file until the “real” EOF?
Whenever I encounter a substitute character http://en.wikipedia.org/wiki/Substitute_character while reading a file in C++ using
Share
Open the file in binary mode instead of text mode. If you’re using
fopen, make open it in one of the"b"modes, e.g."rb". If you’re using a C++ifstreamobject, open it with theios::binaryflag.For example: