NLS Buffer to Small error from NLS_translate

I am using the NLS_translate function to convert LMBCS to UNICODE. I have allocated a buffer much larger than the conversion string e.g. 2k when the strings are <200 bytes. After the first call, I get the NLS_BUFFERTOOSMALL status returned (0xa000) and the output length is 0. I don’t see a way to tell the routine how big the output buffer is so I am not sure how to get around this problem. Has anyone else seen this?

I am using Visual Studio 2003, Windows XP, and the C++ package for the other database access functions.

Any suggestions will be appreciated.

Thank you.

Subject: NLS Buffer to Small error from NLS_translate

Hi Jeff,

I am also facing the same problem as you have mentioned above.

Did you find any solution on the above posted issue? If yes, can you share it with us?

Following is the code snippet for which I am gettign the same issue:

BYTE far szFrenchForm = “_Entrée d’agenda”;

BYTE far *pStringTarget;

NLS_PINFO FAR pInfo;

WORD pSize;

pInfo = OSGetNativeCLS();

if(NULL != pInfo )

{

sError = NLS_translate(

                szFrenchForm,

          	    MAX_SIZE, //255

    	    pStringTarget,

            &pSize,

      	    NLS_SOURCEISLMBCS  ,

            pInfo);

}

Here I am getting sError as 0xa000.

Any suggestions will be appreciated.

Thanks,

Abhi

Subject: RE: NLS Buffer to Small error from NLS_translate

Hello Jeff and Abhi,

I have the same problem , and the problem is disappeared if the debug version is used in my program (Borland C++)

Have you find another solution meantime?

Thank in advance

csaba.korponay@siemens.com