fix byte-order-marker handling when reading VS solution files
I think the handling of a possible byte order marker in a VS solution file is not correct. std::getline reads just the 3 bytes of the BOM as any other character till there is a new line. The BOM at the beginning of a file does not cause std::getline returning an empty string. See also cfe23927097b64bc8ecaf702eaa0212d0a7e5c6f.
thanks for looking into this.
there are plenty of test failures. did you see that?
AssertionError: cppcheck: error: Visual Studio solution file header not found
the path for the solution file used is : test/cli/helloworld/helloworld.sln
@danmar : Thanks for drawing my attention to the failing builds. If I understand the issue correctly, Visual Studio has three different storage formats for solution files
- UTF-8
- Unicode
- ANSI
The main difference between ANSI and UTF-8 that UTF-8 files start with a byte order marker and and empty line. Both, the BOM and the empty line, are afaik not present in the older ANSI format.
This means that current cppcheck code is actually correct. Though, the code comment Skip BOM is slightly misleading as the code skips the BOM and the empty 1st line, as it is the required behavior for solution files with UTF-8 encoding.
This finding renders this PR obsolete.