Boost.Serialization broken for wchar_t
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?
I'm aware of this problem and have had much difficulty in addressing it. I would say stick with 1.57 until I can get it fixed. Hopefully this will be for 1.61 On 12/19/15 5:25 AM, gast128 wrote:
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?
Robert Ramey
I'm aware of this problem and have had much difficulty in addressing it. I would say stick with 1.57 until I can get it fixed. Hopefully this will be for 1.61
That's unfortunate, since we use Boost in production code and an upgrade always creates a lot of turmoil to get that process finished. Small question: what was wrong with the old code?
On 12/19/15 9:53 AM, gast128 wrote:
Robert Ramey
writes: I'm aware of this problem and have had much difficulty in addressing it. I would say stick with 1.57 until I can get it fixed. Hopefully this will be for 1.61
That's unfortunate, since we use Boost in production code and an upgrade always creates a lot of turmoil to get that process finished.
Small question: what was wrong with the old code?
Hmmm - I don't remember now. Generally changes to the serialization library are intended to enhance it. Since 1.57 changes have been made to handle c++11 collections and types fix bugs etc. Also, limited visibility for GCC was implemented. This makes the shared library a lot smaller and faster to load, but consumed quite an effort getting gcc, clang and msvc in sync on this subject. There was a problem in 1.59 where by it woudn't serialize russian characters. I fixed it - with quite an effort, but that left broken wchar_t i/o on some platforms. I declined to check the changes into master due to that. In spite of trying various solutions, I'm still not getting handling of codecvt working accross all platforms. I've been drawn away from this. I want to get it fixed but it's quite an effort and a tedious one at that. Robert Ramey
participants (2)
-
gast128
-
Robert Ramey