1ldap_charset(3LDAP)         LDAP Library Functions         ldap_charset(3LDAP)
2
3
4

NAME

6       ldap_charset,       ldap_set_string_translators,      ldap_t61_to_8859,
7       ldap_8859_to_t61,    ldap_translate_from_t61,    ldap_translate_to_t61,
8       ldap_enable_translation - LDAP character set translation functions
9

SYNOPSIS

11       cc[ flag... ] file... -lldap[ library... ]
12       #include <lber.h>
13       #include <ldap.h>
14
15       void ldap_set_string_translators(LDAP *ld,
16            BERTranslateProc encode_proc, BERTranslateProc decodeproc);
17
18
19       typedef int(*BERTranslateProc)(char **bufp, unsigned long *buflenp,
20            int free_input);
21
22
23       int ldap_t61_to_8859(char **bufp, unsigned long *buflenp,
24            int free_input);
25
26
27       int ldap_8859_to_t61(char **bufp, unsigned long *buflenp,
28            int free_input);
29
30
31       int ldap_translate_from_t61(LDAP *ld, char **bufp,
32            unsigned long *lenp, int free_input);
33
34
35       int ldap_translate_to_t61(LDAP *ld, char **bufp, unsigned long *lenp,
36            int free_input);
37
38
39       void ldap_enable_translation(LDAP *ld, LDAPMessage *entry, int enable);
40
41

DESCRIPTION

43       These  functions  are  used to used to enable translation  of character
44       strings used in the LDAP library to and from  the  T.61  character  set
45       used  in the LDAP protocol.  These  functions are only available if the
46       LDAP and LBER libraries  are compiled with  STR_TRANSLATION defined. It
47       is  also   possible to turn on character translation by default so that
48       all LDAP library callers will  experience  translation;  see  the  LDAP
49       Make-common source file for details.
50
51
52       ldap_set_string_translators()  sets the translation functions that will
53       be used by the LDAP library.  They are  not  actually  used  until  the
54       ld_lberoptions  field  of  the  LDAP  structure  is  set to include the
55       LBER_TRANSLATE_STRINGS option.
56
57
58       ldap_t61_to_8859() and ldap_8859_to_t61() are translation functions for
59       converting  between  T.61 characters and ISO-8859 characters.  The spe‐
60       cific 8859 character set used is determined at compile time.
61
62
63       ldap_translate_from_t61() is used to translate a string  of  characters
64       from  the  T.61 character set to a different character set.  The actual
65       translation is done using the decode_proc that was passed to a previous
66       call  to ldap_set_string_translators(). On entry, *bufp should point to
67       the start of the T.61 characters to be translated and *lenp should con‐
68       tain  the number of bytes to translate.  If free_input is non-zero, the
69       input buffer will be freed if translation is a success.  If the  trans‐
70       lation is a success, LDAP_SUCCESS will be returned, *bufp will point to
71       a newly malloc'd buffer that contains the  translated  characters,  and
72       *lenp  will  contain the length of the result. If translation fails, an
73       LDAP error code will be returned.
74
75
76       ldap_translate_to_t61() is used to translate a string of characters  to
77       the  T.61  character  set  from  a different character set.  The actual
78       translation is done using the encode_proc that was passed to a previous
79       call  to  ldap_set_string_translators().  This  function is called just
80       like ldap_translate_from_t61().
81
82
83       ldap_enable_translation() is used to turn on or off string  translation
84       for   the   LDAP   entry   entry   (typically   obtained   by   calling
85       ldap_first_entry() or ldap_next_entry() after a successful LDAP  search
86       operation).  If  enable  is zero, translation is disabled; if non-zero,
87       translation is enabled.  This function is useful if you need to  ensure
88       that  a  particular  attribute  is  not translated when it is extracted
89       using ldap_get_values()  or  ldap_get_values_len().  For  example,  you
90       would not want to translate a binary attributes such as jpegPhoto.
91

ATTRIBUTES

93       See attributes(5) for a description of the following attributes:
94
95
96
97
98       ┌─────────────────────────────┬─────────────────────────────┐
99       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
100       │Availability                 │SUNWcsl (32-bit)             │
101       │                             │SUNWcslx (64-bit)            │
102       │Interface Stability          │Evolving                     │
103       └─────────────────────────────┴─────────────────────────────┘
104

SEE ALSO

106       ldap(3LDAP), attributes(5)
107
108
109
110SunOS 5.11                        27 Jan 2002              ldap_charset(3LDAP)
Impressum