ldap_xlate_unicode_to_local() -- Convert String From the UCS-2 (or UNICODE) Encoding to Local Code Page


  Syntax
 #include <ldap.h>
 
 int  ldap_xlate_unicode_to_local(
         char           *inbufp,
         unsigned long  *inlenp,
         char           *outbufp,
         unsigned long  *outlenp )

  Default Public Authority: *USE

  Library Name/Service Program: QSYS/QGLDCLNT

  Threadsafe: Yes

The ldap_xlate_unicode_to_local() API is used to convert a UCS-2 encoded string to the local code page encoding.

It is important to note that translation of strings from a UCS-2 (or UNICODE) encoding to local code page may result in loss of data when one or more characters in the UCS-2 encoding cannot be represented in the local code page. When this occurs, a substitution character replaces any UCS-2 characters that cannot be converted to the local code page.


Authorities and Locks

No IBM® i authority is required.


Parameters

inbufp
(Input) A pointer to the address of the input buffer containing the data to be translated.
inlenp
(Input) Length in bytes of the inbufp buffer. This value is decremented when the conversion is done, such that on return it indicates the length of inlenp buffer that is left to be translated.
outbufp
(Output) A pointer to the address of the output buffer for translated data.
outlenp
(Output) Length in bytes of the outbufp buffer. This value is decremented when the conversion is done, such that on return it indicates the length of outlenp buffer space left available for translated data.

Note that in general, the output buffer should be three times as large as the input buffer if the intent is to translate the entire input buffer in a single call.


Return Value

LDAP_SUCCESS
if the request was successful.

another LDAP error code
if the request was not successful.

Error Conditions

The ldap_xlate_unicode_to_local() API will return an LDAP error code if not successful. See LDAP Client API Error Conditions for possible LDAP error code values.


Error Messages

The following message may be sent from this function.

Message ID Error Message Text
CPF3CF2 E Error(s) occurred during running of ldap_xlate_unicode_to_local API.


Related Information



API introduced: V4R5

[ Back to top | LDAP APIs | APIs by category ]