7 Network Working Group M. Wahl
8 Request for Comments: 2596 Innosoft International, Inc.
9 Category: Standards Track T. Howes
10 Netscape Communications Corp.
14 Use of Language Codes in LDAP
19 This document specifies an Internet standards track protocol for the
20 Internet community, and requests discussion and suggestions for
21 improvements. Please refer to the current edition of the "Internet
22 Official Protocol Standards" (STD 1) for the standardization state
23 and status of this protocol. Distribution of this memo is unlimited.
27 Copyright (C) The Internet Society (1999). All Rights Reserved.
31 The Lightweight Directory Access Protocol [1] provides a means for
32 clients to interrogate and modify information stored in a distributed
33 directory system. The information in the directory is maintained as
34 attributes [2] of entries. Most of these attributes have syntaxes
35 which are human-readable strings, and it is desirable to be able to
36 indicate the natural language associated with attribute values.
38 This document describes how language codes [3] are carried in LDAP
39 and are to be interpreted by LDAP servers. All implementations MUST
40 be prepared to accept language codes in the LDAP protocols. Servers
41 may or may not be capable of storing attributes with language codes
42 in the directory. This document does not specify how to determine
43 whether particular attributes can or cannot have language codes.
45 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
46 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
47 document are to be interpreted as described in RFC 2119 [4].
51 Section 2 of RFC 1766 [3] describes the language code format which is
52 used in LDAP. Briefly, it is a string of ASCII alphabetic characters
53 and hyphens. Examples include "fr", "en-US" and "ja-JP".
58 Wahl & Howes Standards Track [Page 1]
60 RFC 2596 Use of Language Codes in LDAP May 1999
63 Language codes are case insensitive. For example, the language code
64 "en-us" is the same as "EN-US" and "en-US".
66 Implementations MUST NOT otherwise interpret the structure of the
67 code when comparing two codes, and MUST treat them as simply strings
68 of characters. Client and server implementations MUST allow any
69 arbitrary string which follows the patterns given in RFC 1766 to be
70 used as a language code.
72 3. Use of Language Codes in LDAP
74 This section describes how LDAP implementations MUST interpret
75 language codes in performing operations.
77 In general, an attribute with a language code is to be treated as a
78 subtype of the attribute without a language code. If a server does
79 not support storing language codes with attribute values in the DIT,
80 then it MUST always treat an attribute with a language code as an
81 unrecognized attribute.
83 3.1. Attribute Description
85 An attribute consists of a type, a list of options for that type, and
86 a set of one or more values. In LDAP, the type and the options are
87 combined into the AttributeDescription, defined in section 4.1.5 of
88 [1]. This is represented as an attribute type name and a possibly-
89 empty list of options. One of these options associates a natural
90 language with values for that attribute.
92 language-option = "lang-" lang-code
94 lang-code = printable-ascii ; a code as defined in RFC 1766
96 Multiple language options may be present on a particular value.
98 The language code has no effect on the character set encoding for
99 string representations of DirectoryString syntax values; the UTF-8
100 representation of UniversalString (ISO 10646) is always used.
102 Examples of valid AttributeDescription:
106 In LDAP and in examples in this document, a directory attribute is
107 represented as an AttributeDescription with a list of values. Note
108 that the data could be stored in the LDAP server in a different
114 Wahl & Howes Standards Track [Page 2]
116 RFC 2596 Use of Language Codes in LDAP May 1999
119 3.2. Distinguished Names and Relative Distinguished Names
121 No attribute description options are permitted in Distinguished Names
122 or Relative Distinguished Names. Thus language codes MUST NOT be
127 If a language code is present in an AttributeDescription in a search
128 filter, then only attribute values in the directory which match the
129 base attribute type or its subtype, the language code and the
130 assertion value match this filter.
132 Thus for example a filter of an equality match of type "name;lang-
133 en-US" and assertion value "Billy Ray", against the following
136 objectclass: top DOES NOT MATCH (wrong type)
137 objectclass: person DOES NOT MATCH (wrong type)
138 name;lang-EN-US: Billy Ray MATCHES
139 name;lang-EN-US: Billy Bob DOES NOT MATCH (wrong value)
140 CN;lang-en-us: Billy Ray MATCHES
141 CN;lang-EN-US;dynamic: Billy Ray MATCHES
142 CN;lang-en;dynamic: Billy Ray DOES NOT MATCH (differing lang-)
143 name: Billy Ray DOES NOT MATCH (no lang-)
144 SN: Ray DOES NOT MATCH (wrong value)
146 (Note that "CN" and "SN" are subtypes of "name".)
148 Client implementors should however note that providing a language
149 code in a search filter AttributeDescription will often filter out
150 desirable values where the language code does not match exactly. For
151 example, the filter (name;lang-en=Billy Ray) does NOT match the
152 attribute "name;lang-en-US: Billy Ray".
154 If the server does not support storing language codes with attribute
155 values in the DIT, then any filter which includes a language code
156 will always fail to match, as it is an unrecognized attribute type.
157 No error would be returned because of this; a presence filter would
158 evaluate to FALSE and all other forms to Undefined.
160 If no language code is specified in the search filter, then only the
161 base attribute type and the assertion value need match the value in
164 Thus for example a filter of an equality match of type "name" and
165 assertion value "Billy Ray", against the following directory entry
170 Wahl & Howes Standards Track [Page 3]
172 RFC 2596 Use of Language Codes in LDAP May 1999
175 objectclass: top DOES NOT MATCH (wrong type)
176 objectclass: person DOES NOT MATCH (wrong type)
177 name;lang-EN-US: Billy Ray MATCHES
178 name;lang-EN-US: Billy Bob DOES NOT MATCH (wrong value)
179 CN;lang-EN-US;dynamic: Billy Ray MATCHES
180 CN;lang-en;dynamic: Billy Ray MATCHES
181 name: Billy Ray MATCHES
182 SN: Ray DOES NOT MATCH (wrong value)
184 Thus in general, clients SHOULD NOT use the language code option in
185 AttributeDescription fields in search filters.
189 A language code can be present in an AttributeDescription used in a
190 compare request AttributeValueAssertion. This is to be treated by
191 servers the same as the use of language codes in a search filter with
192 an equality match, as described in the previous section. If there is
193 no attribute in the entry with the same subtype and language code,
194 the noSuchAttributeType error will be returned.
196 Thus for example a compare request of type "name" and assertion value
197 "Johann", against an entry with all the following directory entry
201 givenName;lang-de-DE: Johann
205 will cause the server to return compareTrue.
207 However, if the client issued a compare request of type "name;lang-
208 de" and assertion value "Johann" against the above entry, the request
209 would fail with the noSuchAttributeType error.
211 If the server does not support storing language codes with attribute
212 values in the DIT, then any comparison which includes a language code
213 will always fail to locate an attribute type, and noSuchAttributeType
216 Thus in general, clients SHOULD NOT use the language code option in
217 AttributeDescription fields in the compare request.
219 3.5. Requested Attributes in Search
221 Clients MAY provide language codes in AttributeDescription in the
222 requested attribute list in a search request.
226 Wahl & Howes Standards Track [Page 4]
228 RFC 2596 Use of Language Codes in LDAP May 1999
231 If a language code is provided in an attribute description, then only
232 attribute values in a directory entry which have the same language
233 code as that provided are to be returned. Thus if a client requests
234 an attribute "description;lang-en", the server MUST NOT return values
235 of an attribute "description" or "description;lang-fr".
237 Clients MAY provide in the attribute list multiple
238 AttributeDescription which have the same base attribute type but
239 different options. For example a client MAY provide both "name;lang-
240 en" and "name;lang-fr", and this would permit an attribute with
241 either language code to be returned. Note there would be no need to
242 provide both "name" and "name;lang-en" since all subtypes of name
245 If a server does not support storing language codes with attribute
246 values in the DIT, then any attribute descriptions in the list which
247 include language codes are to be ignored, just as if they were
248 unknown attribute types.
250 If a request is made specifying all attributes or an attribute is
251 requested without providing a language code, then all attribute
252 values regardless of their language code are returned.
254 For example, if the client requests a "description" attribute, and a
255 matching entry contains
258 objectclass: organization
260 description: software
261 description;lang-en: software products
262 description;lang-de: Softwareprodukte
263 postalAddress: Berlin 8001 Germany
264 postalAddress;lang-de: Berlin 8001 Deutschland
266 The server will return:
268 description: software
269 description;lang-en: software products
270 description;lang-de: Softwareprodukte
274 Clients MAY provide language codes in AttributeDescription in
275 attributes of a new entry to be created, subject to the limitation
276 that the client MUST NOT use language codes in the attribute value or
277 values which form the RDN of the entry.
282 Wahl & Howes Standards Track [Page 5]
284 RFC 2596 Use of Language Codes in LDAP May 1999
287 A client MAY provide multiple attributes with the same attribute type
288 and value, so long as each attribute has a different language code,
289 and at most one attribute does not have a language code option.
291 Servers which support storing language codes in the DIT MUST allow
292 any attribute it recognizes that has the Directory String syntax to
293 have a language option associated with it. Servers SHOULD allow
294 language options to be associated with other attributes.
296 For example, the following is a legal request.
300 objectclass: residentialPerson
303 CN;lang-en: John Smith
305 streetAddress: 1 University Street
306 streetAddress;lang-en: 1 University Street
307 streetAddress;lang-fr: 1 rue Universite
308 houseIdentifier;lang-fr: 9e etage
310 If a server does not support storing language codes with attribute
311 values in the DIT, then it MUST treat an AttributeDescription with a
312 language code as an unrecognized attribute. If the server forbids the
313 addition of unrecognized attributes then it MUST fail the add request
314 with the appropriate result code.
316 3.7. Modify Operation
318 A client MAY provide a language code in an AttributeDescription as
319 part of a modification element in the modify operation.
321 Attribute types and language codes MUST match exactly against values
322 stored in the directory. For example, if the modification is a
323 "delete", then if the stored values to be deleted have a language
324 code, the language code MUST be provided in the modify operation, and
325 if the stored values to be deleted do not have a language code, then
326 no language code is to be provided.
328 If the server does not support storing language codes with attribute
329 values in the DIT, then it MUST treat an AttributeDescription with a
330 language code as an unrecognized attribute, and MUST fail the request
331 with an appropriate result code.
338 Wahl & Howes Standards Track [Page 6]
340 RFC 2596 Use of Language Codes in LDAP May 1999
343 3.8. Diagnostic Messages
345 Servers SHOULD use only printable ASCII characters in the
346 errorMessage field, as not all clients will be able to display the
347 full range of Unicode.
349 4. Differences from X.500(1997)
351 X.500(1997) defines a different mechanism, contexts, as the means of
352 representing language tags. This section summarizes the major
353 differences in approach.
355 a) An X.500 operation which has specified a language code on a value
356 matches a value in the directory without a language code.
357 b) LDAP references RFC 1766, which allows for IANA registration of
359 c) LDAP does not allow language codes in distinguished names.
360 d) X.500 describes subschema administration procedures to allow
361 language codes to be associated with particular attributes types.
363 5. Security Considerations
365 There are no known security considerations for this document. See
366 the security considerations sections of [1] and [2] for security
367 considerations of LDAP in general.
371 This document is a product of the IETF ASID and LDAPEXT working
372 groups. Martin Duerst provided many valuable comments on an earlier
373 version of this document.
377 [1] Wahl, M., Howes, T. and S. Kille, "Lightweight Directory Access
378 Protocol (v3)", RFC 2251, December 1997.
380 [2] Wahl, M., Coulbeck, A., Howes, T. and S. Kille, "Lightweight
381 X.500 Directory Access Protocol Attribute Syntax Definitions",
382 RFC 2252, December 1997.
384 [3] Alvestrand, H.,"Tags for the Identification of Languages", RFC
387 [4] Bradner, S., "Key words for use in RFCs to Indicate Requirement
388 Levels", BCP 14, RFC 2119, March 1997.
394 Wahl & Howes Standards Track [Page 7]
396 RFC 2596 Use of Language Codes in LDAP May 1999
399 8. Authors' Addresses
402 Innosoft International, Inc.
403 8911 Capital of Texas Hwy Suite 4140
406 EMail: M.Wahl@innosoft.com
410 Netscape Communications Corp.
411 501 E. Middlefield Rd
412 Mountain View, CA 94043 USA
414 Phone: +1 650 937-3419
415 EMail: howes@netscape.com
450 Wahl & Howes Standards Track [Page 8]
452 RFC 2596 Use of Language Codes in LDAP May 1999
455 Full Copyright Statement
457 Copyright (C) The Internet Society (1999). All Rights Reserved.
459 This document and translations of it may be copied and furnished to
460 others, and derivative works that comment on or otherwise explain it
461 or assist in its implementation may be prepared, copied, published
462 and distributed, in whole or in part, without restriction of any
463 kind, provided that the above copyright notice and this paragraph are
464 included on all such copies and derivative works. However, this
465 document itself may not be modified in any way, such as by removing
466 the copyright notice or references to the Internet Society or other
467 Internet organizations, except as needed for the purpose of
468 developing Internet standards in which case the procedures for
469 copyrights defined in the Internet Standards process must be
470 followed, or as required to translate it into languages other than
473 The limited permissions granted above are perpetual and will not be
474 revoked by the Internet Society or its successors or assigns.
476 This document and the information contained herein is provided on an
477 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
478 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
479 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
480 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
481 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
485 Funding for the RFC Editor function is currently provided by the
506 Wahl & Howes Standards Track [Page 9]