Nawal Kishore Gupta wrote:
Dear All,

What is the best way to covert  WCHAR to XMLCh in Linux /Unix build.

What type is WCHAR?  Do you mean wchar_t?

I am getting the following error:
error: no matching function for call to `xercesc_2_7::XercesDOMParser::parse(const WCHAR*&)'

but same thing works fine in Windows unicode and non unicode build.
That's because wchar_t on Windows is UTF-16, which is also the encoding for XMLCh. However, there are not many platforms where wchar_t contains a UTF-16 code point.

It's very difficult to use wchar_t portably. Instead, your application should use XMLCh, and use the local code page transcoder to go between const char* and XMLCh. For static UTF-16 strings, you can create static strings using the Xerces-C constants in XMLUniDefs.hpp. See XMLUni.hpp and XMLUni.cpp for examples.

Dave

Reply via email to