Index: boost/property_tree/detail/xml_parser_utils.hpp =================================================================== --- boost/property_tree/detail/xml_parser_utils.hpp (revision 62110) +++ boost/property_tree/detail/xml_parser_utils.hpp (working copy) @@ -46,6 +46,11 @@ { typedef typename std::basic_string Str; Str r; + + // If s is empty we are done. + if (s.empty()) + return r; + // To properly round-trip spaces and not uglify the XML beyond // recognition, we have to encode them IF the text contains only spaces. Str sp(1, Ch(' '));