ldap_set_locale()-- Change the Locale Used by LDAP




Syntax

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




Threadsafe: Yes

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, as defined in ldaplocale.h.

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

No OS/400 authority is required. All authority checking is done by the LDAP server.

Parameters

locale
(Input) Specifies the locale to be used by LDAP when using conversion apis to convert local 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 *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: 
            string = ldap_set_locale(LC_C);
            string = 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

If ldap_set_locale() will return LDAP error code if not successful. See ldap_error_condt() for possible values for LDAP error codes.

Error Messages

    The following message may be set from this function.
    CPF3CF2 E  Error(s) occurred during running of ldap_set_locale API.

Related Information

    ldap_xlate_local_to_utf8() -- Convert String From the Local to UTF-8 Code Page. 
    ldap_xlate_utf8_to_local() -- Convert String From UTF-8 to Local Code Page.
    ldap_xlate_local_to_unicode() -- Convert String From the Local to UCS-2 Code Page. 
    ldap_xlate_unicode_to_local() -- Convert String From UCS-2 to  Local Code Page. 
    ldap_get_iconv_local_codepage() -- Get the Active LDAP Code Page.
    ldap_set_iconv_local_codepage() -- Set the Active LDAP Code Page.
    ldap_set_iconv_local_charset() -- Set the Active LDAP Character set.
    ldap_get_locale() -- Get the Locale Used by LDAP. 


Top | LDAP APIs List
APIs by category

[Information Center Home Page | Feedback ] [Legal | AS/400 Glossary]