How NOT to skip BOM info (FF FE) when using fread or ifstream?
- by al_lea
I'm trying to use fread/ifstream to read the first 2 bytes of a .csv with BOM info. But following code always skips the first two bytes (which are 'FF FE'):
ifstream is;
is.open (fn, ios::binary );
char buf[2];
is.read(buf, 2);
is.close();
using FILE*/fread does no better.