Added support base64 support for non-UTF8 strings.

This commit is contained in:
Jari Sundell
2026-05-29 17:25:16 +02:00
committed by GitHub
parent 880510073a
commit add305f90c
10 changed files with 159 additions and 73 deletions
+8
View File
@@ -152,10 +152,18 @@ void
print_object_xml(const torrent::Object& obj, tinyxml2::XMLPrinter* printer) {
switch (obj.type()) {
case torrent::Object::TYPE_STRING:
if (obj.flags() & torrent::Object::flag_base64) {
printer->OpenElement("base64", true);
printer->PushText(obj.as_string().c_str());
printer->CloseElement(true);
break;
}
printer->OpenElement("string", true);
printer->PushText(obj.as_string().c_str());
printer->CloseElement(true);
break;
case torrent::Object::TYPE_VALUE:
printer->OpenElement("i8", true);
printer->PushText(std::to_string(obj.as_value()).c_str());