Boost C++ Libraries: Ticket #11915: Bug in xml_iarchive_impl<Archive>::load(std::wstring &ws) https://svn.boost.org/trac10/ticket/11915 <p> There is a problem when serialization calls </p> <pre class="wiki">xml_iarchive_impl&lt;Archive&gt;::load(wchar_t * ws) </pre><p> or </p> <pre class="wiki">xml_iarchive_impl&lt;Archive&gt;::load(std::wstring &amp;ws) </pre><p> in Visual Studio VC 2010. </p> <p> When std::mbrtowc is called in this function needs that "std::mbstate_t mbs" must be initialized to "std::mbstate_t()" in its first loop. Current value is undefined in this platform because mbstate_t is only an int (typedef int mbstate_t). It should be initialized before you use. </p> <p> My proposed fix should be: </p> <pre class="wiki">std::mbstate_t mbs = std::mbstate_t(); </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11915 Trac 1.4.3 Robert Ramey Fri, 15 Jan 2016 16:20:36 GMT <link>https://svn.boost.org/trac10/ticket/11915#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11915#comment:1</guid> <description> <p> Looks good. </p> <p> I can't test vc 2010 - have you made this change and verified that that it addresses the problem? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Fri, 15 Jan 2016 16:21:01 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11915#comment:2 https://svn.boost.org/trac10/ticket/11915#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket anonymous Mon, 18 Jan 2016 16:49:08 GMT <link>https://svn.boost.org/trac10/ticket/11915#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11915#comment:3</guid> <description> <p> I've seen your commit <a class="ext-link" href="https://github.com/boostorg/serialization/commit/6facb61510c845f2e926e6a6dc4a50e068a5792b?diff=unified"><span class="icon">​</span>https://github.com/boostorg/serialization/commit/6facb61510c845f2e926e6a6dc4a50e068a5792b?diff=unified</a> </p> <p> I tried this commit and to me is enough. </p> <p> Although, I think this function </p> <pre class="wiki">xml_iarchive_impl&lt;Archive&gt;::load(wchar_t * ws) </pre><p> needs the same patch in line 101. </p> </description> <category>Ticket</category> </item> </channel> </rss>