At 18.00 01/06/2007 +0530, Pranav, Savkur wrote:
Hello Alberto,
thank you for the reply.
What is the parameter that must be passed to this setEncoding function?
I would try with ISO-8859-1, but it depends on what you are planning
to do later with that CString....
Alberto
Regards,
Pranav
-----Original Message-----
From: ext Alberto Massari [mailto:[EMAIL PROTECTED]
Sent: Friday, June 01, 2007 5:52 PM
To: Pranav, Savkur
Cc: [email protected]
Subject: Re: FW: XMLString::transcode throws exception
Hi Pranav,
I haven't seen this message on the c-users mailing list (but I am cc-ing
it now).
The reason for an exception in XMLString::transcode could be that the
string cannot be converted into the current locale; have you tried using
DOMWriter::setEncoding to force your desired final encoding, then
invoking DOMWriter::writeNode using a MemBufFormatTarget as destination?
Alberto
At 17.31 01/06/2007 +0530, Pranav, Savkur wrote:
> Hello Alberto,
>
> I had mailed this to the mailing list but its probably not
sent.
>Can you pls help me with this
>
>Regards,
>Pranav
>
> We're using Xerces for C++
>
> Our code is like:
>
> XMLCh tempStr[4000];
> XERCES_CPP_NAMESPACE::XMLString::transcode("LS", tempStr, 3999);
>
>XERCES_CPP_NAMESPACE::DOMImplementation *impl =
>XERCES_CPP_NAMESPACE::DOMImplementationRegistry::getDOMImplementation(t
>e
>mpStr);
>
>pSerializer =
>((XERCES_CPP_NAMESPACE::DOMImplementationLS*)impl)->createDOMWriter();
>
> if(0 != pSerializer)
> {
>
>
> XMLCh* pCh = pSerializer->writeToString(*p_pDOMNode);
> char *msg =
>XERCES_CPP_NAMESPACE::XMLString::transcode(pCh);
> CString strRetVal = msg;
> }
>
>
>But the call to transcode in line 2 is causing a generic exception.
>Can you pls tell me what the reason could be? If the code is wrong or
>something?
>This seems to be an intermittent behavior and does not happen always
>
>I have also tried this with:
>
>XERCES_CPP_NAMESPACE::DOMImplementation* impl =
>XERCES_CPP_NAMESPACE::DOMImplementationRegistry::getDOMImplementation(X
>E RCES_CPP_NAMESPACE::XMLString::transcode("Core"));
>
>pSerializer =
>((XERCES_CPP_NAMESPACE::DOMImplementationLS*)impl)->createDOMWriter();
>
>if(0 != pSerializer)
> {
>
>
> XMLCh* pCh = pSerializer->writeToString(*p_pDOMNode);
> char *msg =
>XERCES_CPP_NAMESPACE::XMLString::transcode(pCh);
> CString strRetVal = msg;
> }
>
>With the same result.
>
>
>
>Regards,
>Pranav
>
>
>
>Disclaimer:
>This e-mail may contain trade secrets or privileged, undisclosed or
>otherwise confidential information. If you have received this e-mail in
>error, you are hereby notified that any review, copying or distribution
>of it is strictly prohibited. Please inform us immediately and destroy
>the original transmittal. Thank you for your cooperation.
Disclaimer:
This e-mail may contain trade secrets or privileged, undisclosed or
otherwise confidential information. If you have received this e-mail
in error, you are hereby notified that any review, copying or
distribution of it is strictly prohibited. Please inform us
immediately and destroy the original transmittal. Thank you for your
cooperation.