Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: SAX Via MSXML3.DLL XML Character encoding

From: Peter Nimmo <PeterNimmo@----------.------>
To: NULL
Date: 5/4/2006 6:30:00 AM

Peter Nimmo <PeterNimmo@n...> wrote in
news:Xns97B9929F256B9PeterNnospamtnsofres@1...: 

> "Umut Alev - MSFT" <ualev@h...> wrote in
> news:nKj6g.1719$Th.461@trnddc03: 
> 
>> Actually, all you have to do here is set the encoding on the writer
>> 
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsd
>> k /html/c7ecffcd-ea6f-40a6-956a-dc2e15b70bbb.asp?frame=true 
>> 
>> for more info.
>> 
>> Regards,
>> Umut Alev - MSFT
> Which funnily enough says "The encoding property has no effect for
> BSTR or DOM output." :)
> 
> Anyway I have moved on from there.
> 
> I have just tried to use the ADODB Stream object as the IStream 
> implementation to write out to, but I am getting some strange results.
> 
> I am using C++, and so I did the following:
> 
> m_stream->Open(vtMissing,adModeUnknown,adOpenStreamUnspecified,_bstr_t(
> ), _bstr_t());
> 
> //m_wrt->encoding = _bstr_t("UTF-8");//Not present for first stream
> test m_wrt->output = (IDispatch*)m_stream;
> 
> < Some other stuff>
> 
> m_stream->SaveToFile("c:\\temp\\test.xml",ADODB::adSaveCreateOverWrite)
> ; 
> 
> This worked fine and test.xml looked O.K but at this stage the
> encoding was still UTF-16.
> 
> When I added : m_wrt->encoding = _bstr_t("UTF-8");
> 
> The character encoding declaration suddenly had the hex bytes FF EE,
> at the beginning.
> 
> I find this strange as that is the byte order mark for UTF-16.
> 
> If I use : m_wrt->encoding = _bstr_t("UTF-16");
> 
> Then it disappears.  When using UTF-8 I even tried turning off 
> byteOrderMark, by assingining the property VARIANT_TRUE.That should of 
course read VARIANT_FALSE (note to self don't use copy
and paste). 

I have tried to supercede the previous message, but that's never worked
for me so far. 


Peter


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent