Hi,
We have application for parsing XMLs working fine when digits or English
letters. When input XML file contains Arabic letters, the
TranscodeToLocalCodePage method results an empty string.
Input XML file is UTF-8 encoded. OS: HP-UX B.11.23 ia64, LANG=ar_SA.utf8,
NLS_LANG=AMERICAN_AMERICA.AR8ISO8859P6.
The source code is:
...
static string transStringXalan2Std(const XalanDOMString& xalanString){
string result;
if (xalanString.empty() == true){
result = "";
}
else{
//conversion from UTF-16 to UTF-8
CharVectorType theString;
TranscodeToLocalCodePage(xalanString, theString,
true);
// the result from TranscodeToLocalCodePage - theString, is zero sized when
xalanString contains Arabic letters
....
Invocating method:
..
string InvoiceXML::getNodeValue(string xPath){
string result;
const XalanDOMString expression(xPath.c_str());
// evaluate the XPath expresion
XalanNode* const found = xPathEvaluator->selectSingleNode(
dom_support,
invoiceXalan,
expression.c_str(),
this->namespace_node);
if (found){
if (found->getNodeType() == XalanNode::ATTRIBUTE_NODE)
{
// easy job for node attributes
result =
InvoiceXML::transStringXalan2Std(found->getNodeValue());
}
.
Thanks in advance for any help!
Regards,
Plamen