mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-05 21:59:21 +00:00
Added support base64 support for non-UTF8 strings.
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user