ldap_set_locale() -- Change the Locale Used by LDAP


  Syntax
 #include <ldap.h>
 
 int  ldap_set_locale(
         char           *locale )

  Default Public Authority: *USE

  Library Name/Service Program: QSYS/QGLDCLNT

  Threadsafe: No

The ldap_set_locale() API is used to change the locale used by LDAP for conversions between the local code page and UTF-8 or Unicode. Unless explicitly set with the ldap_set_locale() API, LDAP will use the application's default locale. To force the LDAP library to use another locale, specify the appropriate locale string.

Note that the specified locale is applicable to all conversions by the LDAP library within the applications address space. The LDAP locale should be set or changed only when there is no other LDAP activity occuring within the application on other threads.


Authorities and Locks

*R authority is needed to the selected locale file and *X to the associated directories.


Parameters

locale
(Input) The locale to be used by LDAP when using conversion apis to convert local text to/from UTF-8 or Unicode. If the locale is not explicitly set, the LDAP library will use the application's default locale. To force the LDAP library to use another locale, specify the appropriate locale string.

You can set the value of locale to C, "", LC_C or the IFS pathname of a *LOCALE object. A locale value of C indicates the default C environment. A locale value of "" tells ldap_set_locale() to use the default locale for the implementation.

Examples:

 rc = ldap_set_locale(LC_C);

 rc = ldap_set_locale("/qsys.lib/en_us.locale");

Return Value

LDAP_SUCCESS
if the request was successful.

another LDAP error code
if the request was not successful.

Error Conditions

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


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_set_locale API.


Related Information



API introduced: V4R5

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