On 2 June 2010 16:41,  <[email protected]> wrote:
> Hi,
>
>
>
>  I know this issue might have been asked a thousand times over, but  I am
> not able to resolve the issue. My situation is this.
>
>
>
> 1.       I have an xml file called b.xml whose encoding attribute is UTF-16.
> (attached along with this email)
>
> 2.       I embed this file as a resource into my visual studio project.
>
> 3.       When the project starts up, I read this file into a variable and
> need to pass it to Libxml2 to parse. How do I accomplish it?
>
>
>
> The problems:
>
>
>
> 1.       I cannot read the file into a char* as this file contains  wide
> characters. So I load them on to a wstring.  After which I realized  Libxml2
> constraints of not allowing wchar strings. So I am trying to convert my
> wchar* to char* .
>
> 2.       Again I have 2 options here : either bad cast it or use
> WidetoMultiByte to convert to char*. I did both of them.
>
>
>
> 3.       After this,  I called XmlReadMemory API in which I understand I can
> specify the encoding. I  gave NULL and UTF-16 in 2 separate attempts.
>
>
>
> 4.       At the end of it, I cannot correctly parse and I get a NULL
> xmlDocPtr. Any ideas on how should I go about solving this?
>
>
>
> Thanks,
>
> Ram
>
>
>
> _______________________________________________
> xml mailing list, project page  http://xmlsoft.org/
> [email protected]
> http://mail.gnome.org/mailman/listinfo/xml
>
>

Does/will/can the endian make a difference?

My editor says the file is UTF-16 LE (Little Endian).

Is having a BOM normal? Does the file need to be BE for VS?







-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to