fix trim utf8 bom
@@ -120,7 +120,12 @@ int IniParser::LoadFromFile(const char* filepath) {
std::string str;
file.readall(str);
- return LoadFromMem(str.c_str());
+ const char* c_str = str.c_str();
+ unsigned char utf8_bom[3] = { 0xEF, 0xBB, 0xBF };
+ if (str.size() >= 3 && memcmp(c_str, utf8_bom, 3) == 0) {
+ c_str += 3;
+ }
+ return LoadFromMem(c_str);
}
int IniParser::LoadFromMem(const char* data) {
