"liu lang" <[EMAIL PROTECTED]> writes:

> Hello
> I am chinese C++ programmer. This morning I was downloading XML4C from
> your site.
> 
> And I writed a simple processing XML file application at Solaris 2.6.
> I writting my code bellowing:
> ===========================================
> void Handler::startElement (const XMLCh *const uri,const XMLCh *const
>                             localname,const XMLCh *const qname,
>                              const Attributes &attrs)
> {
>     printf("--%s--\n", localname);
> }

localname is an XMLCh* encoded in UTF-16. Passing it to printf() as if
it was a char* is not what you want. You must transcode it into a
char* first:

  char* ln = XMLString::transcode(localname);
  printf("--%s--\n", ln);
  delete [] ln;

transcode() allocates memory that you are responsible for.

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to