4#include "../Text/Utf8Sanitizer.h"
7namespace Odb::Lib::ProductModel
17 template <
typename TPbMap,
typename TEntries>
18 void FillProtobufMapWithSanitizedKeys(TPbMap& pbMap,
const TEntries& entries)
20 for (
const auto& kv : entries)
23 if (pbMap.find(sanitizedKey) != pbMap.end())
25 logwarn(
"UTF-8 sanitization collision in protobuf map: key \"" + kv.first +
26 "\" sanitizes to a key that is already present; keeping the first entry");
29 pbMap[sanitizedKey] = *kv.second->to_protobuf();
std::string ToUtf8(std::string_view input)
Converts input to valid UTF-8.