Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Boost::serialization with unicode values

Boost::serialization with unicode values

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptoolsxmljson
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    varunpandeyengg
    wrote on last edited by
    #1

    Hey guys, I am new to boost. I have to work with boost::serialization. My class is having a member that is wstring. This wstring may have unicode values like

    ഡഢണതഥദധന

    [this is just some garbage I tried to test it with...] When I try to add the unicode member to the xml_oarchive, it gives me the following assert

    Quote:

    Assertion failed! Program: ... File: [Some_Path]\Tools\Boost\.../mb_fro...har.hpp Line: 93 Expression: -1 != m_bend For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts

    Following is the code snippet... Help me guys, I am stuck :confused:

    // Boost headers
    #include "boost\archive\xml_oarchive.hpp"
    #include "boost\serialization\list.hpp"
    #include "boost\serialization\string.hpp"

    std::stringstream StringStream;
    boost::archive::xml_oarchive oa(StringStream, flags);
    oa << boost::serialization::make_nvp("Tag", obj_with_wstring);

    //Serialize method of the class with obj_with_wstring
    serialize(Archive & ar, const unsigned int version)
    {
    ar & boost::serialization::make_nvp("tag", m_wstrUnicode);
    }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups