Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
There is a string "Ë=D5+"!?!", when it is stored in char* variable it is converted to "Ã=D5+"!?!". I guess this is due to byte size.

ASCII value of Ë is 203 (UNICODE character)

const XMLCh* pXValue = "Ë=D5+"!?!";
char* pValue = XMLString::transcode( pXValue );


After calling of function XMLString::transcode(Xerces Library function), pValue contain "Ã=D5+"!?!" string which is wrong.

Note : In Windows it is working fine but in Linux it creates problem.

Language : VC++
Platform : Windows and Linux
Framework : Visual Studio 2012
Posted

This looks like a source file encoding issue. Is your .cpp file encoded in UTF-8? You can use the
-finput-charset=UTF-8
on GCC command line to specify the encoding of your source file.
 
Share this answer
 
Thanks Vaclav Zeman for reply and I tried as you suggested but that didn't resolve my problem.

The XMLCh represent 2 byte on Window and as well on Linux but this value( "Ë=D5+"!?!" ) require 4 byte representation.
So I create a function which convert 4 byte to 2 byte and it worked.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900