I have found the solution by reading the following implementation note: http://www.boost.org/doc/libs/1_55_0/libs/serialization/doc/implementation.html#charencoding
When constructing an archive with the default flag, the stream's locale is changed to address character encoding issues, but this mechanism can be disabled using flag boost::archive::no_codecvt
.
If I replace the line
xml_iarchive iar(iss);
with
xml_iarchive iar(iss, no_codecvt);
then it works.