You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Ram <ra...@yahoo.com> on 2005/07/09 20:39:33 UTC

XMLString::transcode() + japanese string + ABR

Hi,

Using xerces-c 2.5 (with ICU 2.4) I am reading some 
japanese characters from a XML file and passing them
to some othe functions. The  file is proper with
japanese characters. I am able to view it properly on
a japanese PC from Internet Explorer. So its content
is valid input.

  I am using following calls.
  char *cstr =
XMLString::transcode(leafnode->getNodeValue());
string str = cstr OR string str =
string(cstr,strlen(cstr));
-- Purify shows a Array bound read of 4 bytes on above
line.
strlen(cstr) returns 40
XMLString::stringLen(leafnode->getNodeValue()) returns
22. 

It seems that transcode is returning a string which is
not properly null terminated. I am getting some junk
characters appended to actual value.
 
The above code works fine on Windows & RH7.3. I am
facing this issue only on RH9 & Solaris.
(LC_CTYPE points to en_US.UTF-8 )

Has anybody faced similar problem before ?

Thanks for your time.

-> Ram


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org