[Serialisation] Using wide character

Hi, first sorry for my bad English. I try to use wide characters with archive to serialize into xml, and I don't know the good way to do this. Until now, we used serialization with ASCII characters and it works fine. This is the part of the code for the ASCII: *std::ifstream oInputStream(szXmlDefinition.c_str()); boost::archive::xml_iarchive oXmlInputArchive(oInputStream); oXmlInputArchive >> SERIALIZE_MEMBER(szNomObjet, oObjet );* For the UNICODE I try to use wiarchive like this : *std::wistringstream oInputStream(szXmlDefinition.c_str()); boost::archive::xml_wiarchive oXmlInputArchive(oInputStream); oXmlInputArchive >> SERIALIZE_MEMBER(szNomObjet, oObjet );* but Visual C++ 2005 doesn't find xml_wiarchive during the link operation. Is it the good way to use wides character with archive and serialisaztion or not ? Please helpe me :) Thx This email is confidential. If you are not the intended recipient you must not disclose or use the information contained in it. If you have received this email in error please notify us immediately by return email and delete this email and any attachments. Vix Technology is not responsible for any changes made to this email or any attachments, other than those made by Vix Technology, or for the effect of the changes on the meaning of the email or any attachments. Vix Technology accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access.

Hi, Problem found it's the Treat wchar_t as Built-in Type which is set to No (/Zc:wchar_t-) in our webservices. But how is it possible to force boost to accept this option for the serialization ?? Thx On Thu, Feb 10, 2011 at 11:31 AM, Vincent Capicotto < vincent.capicotto@vixtechnology.com> wrote:
Hi,
first sorry for my bad English. I try to use wide characters with archive to serialize into xml, and I don't know the good way to do this. Until now, we used serialization with ASCII characters and it works fine. This is the part of the code for the ASCII:
*std::ifstream oInputStream(szXmlDefinition.c_str()); boost::archive::xml_iarchive oXmlInputArchive(oInputStream); oXmlInputArchive >> SERIALIZE_MEMBER(szNomObjet, oObjet );*
For the UNICODE I try to use wiarchive like this :
*std::wistringstream oInputStream(szXmlDefinition.c_str()); boost::archive::xml_wiarchive oXmlInputArchive(oInputStream); oXmlInputArchive >> SERIALIZE_MEMBER(szNomObjet, oObjet );*
but Visual C++ 2005 doesn't find xml_wiarchive during the link operation.
Is it the good way to use wides character with archive and serialisaztion or not ?
Please helpe me :)
Thx
This email is confidential. If you are not the intended recipient you must not disclose or use the information contained in it. If you have received this email in error please notify us immediately by return email and delete this email and any attachments. Vix Technology is not responsible for any changes made to this email or any attachments, other than those made by Vix Technology, or for the effect of the changes on the meaning of the email or any attachments. Vix Technology accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access.

Vincent Capicotto wrote:
Hi,
Problem found it's the Treat wchar_t as Built-in Type which is set to No (/Zc:wchar_t-) in our webservices. But how is it possible to force boost to accept this option for the serialization ??
Thx
I believe this can work. BUT you have to rebuild the library with the same setting. That is. if you want to build your application with usage of wchar_t set to NO, you have to link with a library which is built with the same setting. The reason that I believe that this can work is that library used to be built this way before microsoft had the wchar_t type implemented. Note that there is also a setting in boot config.h which is related to this. If you build with NO wchar_t, you should check that boost/config detects this properly. Robert Ramey
participants (2)
-
Robert Ramey
-
Vincent Capicotto