使用unicode值进行Boost :: serialization - REPOST [英] Boost::serialization with unicode values - REPOST
问题描述
嘿伙计们,
我是新手。我必须使用boost :: serialization。
我的班级成员是wstring。这个wstring可能有unicode值
喜欢
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
ഡഢണതഥദധന
[这只是我尝试用它测试它的一些垃圾......]
当我尝试将unicode成员添加到 xml_oarchive 时,它会给我以下断言
[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
断言失败!
程序:...
文件:[Some_Path] \ Tools \ Boost \ ... / mb_fro ... har.hpp
行:93
表达式:-1!= m_bend
有关程序如何导致断言的信息
失败,看看关于断言的Visual C ++文档
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);
}
我也在讨论区发布了同样的问题......请原谅我......
I have posted the same question on discussion board too... Please excuse me for that...
推荐答案
请不要重新发布相同的问题 [ ^ ]在多个论坛中。
Please do not repost the same question[^] in multiple forums.
这篇关于使用unicode值进行Boost :: serialization - REPOST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!