I've got a UTF-8 format (no BOM) text file that I want to read from.
I open it with
and everything looks OK to that point. Later I try to get a wide(?)character from it withCode:_tfopen_s(&f->fh, buf, "rb, ccs=UTF-8");
but it seems to have forgotten that the file is in UTF-8 and is instead treating it like it is in UTF-16(?).Code:_TINT i = _fgettc(f->fh);
I guess I could just take one byte at a time with fgetc and post-process it to cope with multi-byte characters but is that the way you're supposed to do it or have I missed something?
I was expecting that the 'get' function would take as many bytes as needed based on the Unicode encoding used (UTF-8) and put them together for me. Otherwise what's the point of telling it to open as UTF-8 in the first place?