Hi Dave,

WCHAR is of type wchar_t.  I think it is a Microsoft defined type.
Can you give me an example.  This is what I have

void DsapiSax2Handler::characters
(
const XMLCh* const pChars,
const unsigned int uiLength
)
{
printf("Number of chars = %d\n", uiLength);

for (unsigned int i = 0; i < uiLength; i++)
        {
        if (pChars[i] == 0)
                {
                printf("Breaking out of loop 1\n");
                break;
                }
        int ch = pChars[i];
        printf("pChars=%d\n", ch);
        }
}

I get the following dump:
pchars=72
pchars=105
pchars=26085

These are the correct values for "Hi?" (the ? is acting as a place holder for
japanese character \u65e5).  Ultimately, all I want to do is pass this onto a method
that is expecting WCHAR (or wchar_t).  How would a transcoder apply here?

fred

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2003 2:00 PM
To: [EMAIL PROTECTED]
Subject: Re: Convert XmlCh to wchar






Hi Fred,

First of all, you'll need to know the encoding of the destination type.
What type is WCHAR?  If it's wchar_t, then the encoding is
system-dependent.  Once you know the encoding, then you'll need a
transcoder from UTF-16 to that encoding.

Dave



                                                                                       
                                                     
                      "Fred Grafe"                                                     
                                                     
                      <[EMAIL PROTECTED]         To:      <[EMAIL PROTECTED]>          
                                             
                      oze.com>                 cc:      (bcc: David N 
Bertoni/Cambridge/IBM)                                                
                                               Subject: Convert XmlCh to wchar         
                                                     
                      06/06/2003 10:50                                                 
                                                     
                      AM                                                               
                                                     
                      Please respond                                                   
                                                     
                      to xerces-c-dev                                                  
                                                     
                                                                                       
                                                     



Hi

How can I convert a XMLCh* to a WCHAR*??

thanks
fred


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


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

Reply via email to