[db] Prepare strings as utf-8.

This commit is contained in:
lzwdgc 2020-09-18 23:30:54 +03:00
parent 8fdac09842
commit 217ba181c0

View file

@ -149,9 +149,9 @@ void db::open(const path &p)
polygon4::tools::db::processed_db db::process() const polygon4::tools::db::processed_db db::process() const
{ {
auto process_string = [](const auto &s) auto process_string = [](const std::string &s)
{ {
return str2utf8(s); return str2utf8(s.c_str());
}; };
polygon4::tools::db::processed_db pdb; polygon4::tools::db::processed_db pdb;
@ -170,7 +170,7 @@ polygon4::tools::db::processed_db db::process() const
switch (fld->second.type) switch (fld->second.type)
{ {
case FieldType::String: case FieldType::String:
r[name] = process_string(f.s.c_str()); r[name] = process_string(f.s);
break; break;
case FieldType::Integer: case FieldType::Integer:
r[name] = f.i; r[name] = f.i;