Boost logo

Boost Users :

Subject: [Boost-users] Boost.Serialization broken for wchar_t
From: gast128 (gast128_at_[hidden])
Date: 2015-12-19 08:25:02


following code used to work in boost 1.57

void f()
{
    std::wstring wstr = L"\u20AC";
    
    std::wofstream ofs(L"c:\\temp\\bla.xml");
    
    boost::archive::xml_woarchive oa(ofs);

    oa << boost::serialization::make_nvp("tag", wstr);
}

However in 1.60 it gives an exception, since it cannot convert the uniocde
character. It seems that in 1.57 in xml_woarchive_impl the
utf8_codecvt_facet is set, but this has been disabled in 1.60. What is the
solution / workaround?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net