Network Working Group                                            M. Wahl
Request for Comments: 2596                  Innosoft International, Inc.
Category: Standards Track                                       T. Howes
                                           Netscape Communications Corp.
                                                                May 1999
        
Network Working Group                                            M. Wahl
Request for Comments: 2596                  Innosoft International, Inc.
Category: Standards Track                                       T. Howes
                                           Netscape Communications Corp.
                                                                May 1999
        

Use of Language Codes in LDAP

LDAP中语言代码的使用

Status of this Memo

本备忘录的状况

This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.

本文件规定了互联网社区的互联网标准跟踪协议,并要求进行讨论和提出改进建议。有关本协议的标准化状态和状态,请参考当前版本的“互联网官方协议标准”(STD 1)。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (C) The Internet Society (1999). All Rights Reserved.

版权所有(C)互联网协会(1999年)。版权所有。

1. Abstract
1. 摘要

The Lightweight Directory Access Protocol [1] provides a means for clients to interrogate and modify information stored in a distributed directory system. The information in the directory is maintained as attributes [2] of entries. Most of these attributes have syntaxes which are human-readable strings, and it is desirable to be able to indicate the natural language associated with attribute values.

轻量级目录访问协议[1]为客户端提供了一种查询和修改分布式目录系统中存储的信息的方法。目录中的信息作为条目的属性[2]进行维护。这些属性中的大多数都具有人类可读字符串的语法,并且希望能够指示与属性值相关联的自然语言。

This document describes how language codes [3] are carried in LDAP and are to be interpreted by LDAP servers. All implementations MUST be prepared to accept language codes in the LDAP protocols. Servers may or may not be capable of storing attributes with language codes in the directory. This document does not specify how to determine whether particular attributes can or cannot have language codes.

本文档描述了语言代码[3]如何在LDAP中传输,以及如何由LDAP服务器解释。所有实现都必须准备好接受LDAP协议中的语言代码。服务器可能能够也可能无法在目录中存储带有语言代码的属性。本文档未指定如何确定特定属性是否可以包含语言代码。

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [4].

本文件中的关键词“必须”、“不得”、“要求”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照RFC 2119[4]中所述进行解释。

2. Language Codes
2. 语言代码

Section 2 of RFC 1766 [3] describes the language code format which is used in LDAP. Briefly, it is a string of ASCII alphabetic characters and hyphens. Examples include "fr", "en-US" and "ja-JP".

RFC1766[3]的第2节描述了LDAP中使用的语言代码格式。简而言之,它是一个ASCII字母字符和连字符的字符串。例如“fr”、“en-US”和“ja-JP”。

Language codes are case insensitive. For example, the language code "en-us" is the same as "EN-US" and "en-US".

语言代码不区分大小写。例如,语言代码“en-us”与“en-us”和“en-us”相同。

Implementations MUST NOT otherwise interpret the structure of the code when comparing two codes, and MUST treat them as simply strings of characters. Client and server implementations MUST allow any arbitrary string which follows the patterns given in RFC 1766 to be used as a language code.

在比较两个代码时,实现不能以其他方式解释代码的结构,必须将它们视为简单的字符串。客户机和服务器实现必须允许任何遵循RFC1766中给出的模式的任意字符串用作语言代码。

3. Use of Language Codes in LDAP
3. LDAP中语言代码的使用

This section describes how LDAP implementations MUST interpret language codes in performing operations.

本节介绍LDAP实现在执行操作时必须如何解释语言代码。

In general, an attribute with a language code is to be treated as a subtype of the attribute without a language code. If a server does not support storing language codes with attribute values in the DIT, then it MUST always treat an attribute with a language code as an unrecognized attribute.

通常,具有语言代码的属性将被视为不具有语言代码的属性的子类型。如果服务器不支持在DIT中存储带有属性值的语言代码,则必须始终将带有语言代码的属性视为无法识别的属性。

3.1. Attribute Description
3.1. 属性描述

An attribute consists of a type, a list of options for that type, and a set of one or more values. In LDAP, the type and the options are combined into the AttributeDescription, defined in section 4.1.5 of [1]. This is represented as an attribute type name and a possibly-empty list of options. One of these options associates a natural language with values for that attribute.

属性由一个类型、该类型的选项列表和一组一个或多个值组成。在LDAP中,类型和选项组合到[1]的第4.1.5节中定义的AttributeDescription中。这表示为属性类型名称和可能为空的选项列表。其中一个选项将自然语言与该属性的值相关联。

language-option = "lang-" lang-code

language option=“lang-”lang代码

lang-code = printable-ascii ; a code as defined in RFC 1766

lang代码=可打印的ascii码;RFC 1766中定义的代码

Multiple language options may be present on a particular value.

特定值上可能存在多个语言选项。

The language code has no effect on the character set encoding for string representations of DirectoryString syntax values; the UTF-8 representation of UniversalString (ISO 10646) is always used.

语言代码对DirectoryString语法值的字符串表示的字符集编码没有影响;始终使用UniversalString(ISO 10646)的UTF-8表示形式。

Examples of valid AttributeDescription: givenName;lang-en-US CN;lang-ja

有效属性描述的示例:givenName;朗恩美国中国;朗佳

In LDAP and in examples in this document, a directory attribute is represented as an AttributeDescription with a list of values. Note that the data could be stored in the LDAP server in a different representation.

在LDAP和本文档的示例中,目录属性表示为带有值列表的AttributeDescription。请注意,数据可以以不同的表示形式存储在LDAP服务器中。

3.2. Distinguished Names and Relative Distinguished Names
3.2. 可分辨名称和相对可分辨名称

No attribute description options are permitted in Distinguished Names or Relative Distinguished Names. Thus language codes MUST NOT be used in forming DNs.

可分辨名称或相对可分辨名称中不允许使用属性描述选项。因此,在形成DNs时不得使用语言代码。

3.3. Search Filter
3.3. 搜索过滤器

If a language code is present in an AttributeDescription in a search filter, then only attribute values in the directory which match the base attribute type or its subtype, the language code and the assertion value match this filter.

如果搜索筛选器中的AttributeDescription中存在语言代码,则目录中只有与基本属性类型或其子类型、语言代码和断言值匹配的属性值与此筛选器匹配。

Thus for example a filter of an equality match of type "name;lang-en-US" and assertion value "Billy Ray", against the following directory entry

因此,例如,针对以下目录条目,使用类型为“name;lang en US”和断言值为“Billy Ray”的相等匹配过滤器

   objectclass: top                     DOES NOT MATCH (wrong type)
   objectclass: person                  DOES NOT MATCH (wrong type)
   name;lang-EN-US: Billy Ray           MATCHES
   name;lang-EN-US: Billy Bob           DOES NOT MATCH (wrong value)
   CN;lang-en-us: Billy Ray                MATCHES
   CN;lang-EN-US;dynamic: Billy Ray     MATCHES
   CN;lang-en;dynamic: Billy Ray        DOES NOT MATCH (differing lang-)
   name: Billy Ray                      DOES NOT MATCH (no lang-)
   SN: Ray                              DOES NOT MATCH (wrong value)
        
   objectclass: top                     DOES NOT MATCH (wrong type)
   objectclass: person                  DOES NOT MATCH (wrong type)
   name;lang-EN-US: Billy Ray           MATCHES
   name;lang-EN-US: Billy Bob           DOES NOT MATCH (wrong value)
   CN;lang-en-us: Billy Ray                MATCHES
   CN;lang-EN-US;dynamic: Billy Ray     MATCHES
   CN;lang-en;dynamic: Billy Ray        DOES NOT MATCH (differing lang-)
   name: Billy Ray                      DOES NOT MATCH (no lang-)
   SN: Ray                              DOES NOT MATCH (wrong value)
        

(Note that "CN" and "SN" are subtypes of "name".)

(请注意,“CN”和“SN”是“名称”的子类型。)

Client implementors should however note that providing a language code in a search filter AttributeDescription will often filter out desirable values where the language code does not match exactly. For example, the filter (name;lang-en=Billy Ray) does NOT match the attribute "name;lang-en-US: Billy Ray".

但是,客户机实现人员应该注意,在搜索筛选器属性描述中提供语言代码通常会过滤掉语言代码不完全匹配的所需值。例如,过滤器(name;lang en=Billy Ray)与属性“name;lang en US:Billy Ray”不匹配。

If the server does not support storing language codes with attribute values in the DIT, then any filter which includes a language code will always fail to match, as it is an unrecognized attribute type. No error would be returned because of this; a presence filter would evaluate to FALSE and all other forms to Undefined.

如果服务器不支持在DIT中存储带有属性值的语言代码,则任何包含语言代码的筛选器都将始终无法匹配,因为它是无法识别的属性类型。不会因此返回任何错误;状态筛选器的计算结果为FALSE,所有其他形式的计算结果为Undefined。

If no language code is specified in the search filter, then only the base attribute type and the assertion value need match the value in the directory.

如果搜索筛选器中未指定语言代码,则只有基本属性类型和断言值需要与目录中的值匹配。

Thus for example a filter of an equality match of type "name" and assertion value "Billy Ray", against the following directory entry

因此,例如,针对以下目录条目,筛选类型为“name”和断言值为“Billy Ray”的相等匹配

   objectclass: top                     DOES NOT MATCH (wrong type)
   objectclass: person                  DOES NOT MATCH (wrong type)
   name;lang-EN-US: Billy Ray           MATCHES
   name;lang-EN-US: Billy Bob           DOES NOT MATCH (wrong value)
   CN;lang-EN-US;dynamic: Billy Ray     MATCHES
   CN;lang-en;dynamic: Billy Ray        MATCHES
   name: Billy Ray                      MATCHES
   SN: Ray                              DOES NOT MATCH (wrong value)
        
   objectclass: top                     DOES NOT MATCH (wrong type)
   objectclass: person                  DOES NOT MATCH (wrong type)
   name;lang-EN-US: Billy Ray           MATCHES
   name;lang-EN-US: Billy Bob           DOES NOT MATCH (wrong value)
   CN;lang-EN-US;dynamic: Billy Ray     MATCHES
   CN;lang-en;dynamic: Billy Ray        MATCHES
   name: Billy Ray                      MATCHES
   SN: Ray                              DOES NOT MATCH (wrong value)
        

Thus in general, clients SHOULD NOT use the language code option in AttributeDescription fields in search filters.

因此,一般来说,客户端不应在搜索筛选器的AttributeDescription字段中使用language code选项。

3.4. Compare
3.4. 比较

A language code can be present in an AttributeDescription used in a compare request AttributeValueAssertion. This is to be treated by servers the same as the use of language codes in a search filter with an equality match, as described in the previous section. If there is no attribute in the entry with the same subtype and language code, the noSuchAttributeType error will be returned.

语言代码可以出现在比较请求AttributeValueAssertion中使用的AttributeDescription中。服务器对这一点的处理与在具有相等匹配的搜索筛选器中使用语言代码的处理相同,如前一节所述。如果条目中没有具有相同子类型和语言代码的属性,则将返回noSuchAttributeType错误。

Thus for example a compare request of type "name" and assertion value "Johann", against an entry with all the following directory entry

因此,例如,将类型为“name”和断言值为“Johann”的请求与具有以下所有目录项的条目进行比较

objectclass: top objectclass: person givenName;lang-de-DE: Johann CN: Johann Sibelius SN: Sibelius

objectclass:top objectclass:person-givenName;郎德德:约翰中国:约翰西贝柳斯序号:西贝柳斯

will cause the server to return compareTrue.

将导致服务器返回compareTrue。

However, if the client issued a compare request of type "name;lang-de" and assertion value "Johann" against the above entry, the request would fail with the noSuchAttributeType error.

但是,如果客户机针对上述条目发出类型为“name;lang de”和断言值为“Johann”的比较请求,则请求将失败,并出现noSuchAttributeType错误。

If the server does not support storing language codes with attribute values in the DIT, then any comparison which includes a language code will always fail to locate an attribute type, and noSuchAttributeType will be returned.

如果服务器不支持在DIT中存储带有属性值的语言代码,则包含语言代码的任何比较都将始终无法找到属性类型,并且将返回noSuchAttributeType。

Thus in general, clients SHOULD NOT use the language code option in AttributeDescription fields in the compare request.

因此,一般来说,客户端不应该在比较请求的AttributeDescription字段中使用language code选项。

3.5. Requested Attributes in Search
3.5. 搜索中请求的属性

Clients MAY provide language codes in AttributeDescription in the requested attribute list in a search request.

客户端可以在搜索请求中请求的属性列表中的属性描述中提供语言代码。

If a language code is provided in an attribute description, then only attribute values in a directory entry which have the same language code as that provided are to be returned. Thus if a client requests an attribute "description;lang-en", the server MUST NOT return values of an attribute "description" or "description;lang-fr".

如果属性描述中提供了语言代码,则仅返回目录条目中与所提供语言代码相同的属性值。因此,如果客户机请求属性“description;lang en”,则服务器不得返回属性“description”或“description;lang fr”的值。

Clients MAY provide in the attribute list multiple AttributeDescription which have the same base attribute type but different options. For example a client MAY provide both "name;lang-en" and "name;lang-fr", and this would permit an attribute with either language code to be returned. Note there would be no need to provide both "name" and "name;lang-en" since all subtypes of name would match "name".

客户端可以在属性列表中提供多个AttributeDescription,这些AttributeDescription具有相同的基本属性类型,但具有不同的选项。例如,客户机可能同时提供“name;lang en”和“name;lang fr”,这将允许返回带有任一语言代码的属性。注意:不需要同时提供“name”和“name;lang en”,因为name的所有子类型都将匹配“name”。

If a server does not support storing language codes with attribute values in the DIT, then any attribute descriptions in the list which include language codes are to be ignored, just as if they were unknown attribute types.

如果服务器不支持在DIT中存储带有属性值的语言代码,则列表中包含语言代码的任何属性描述都将被忽略,就像它们是未知的属性类型一样。

If a request is made specifying all attributes or an attribute is requested without providing a language code, then all attribute values regardless of their language code are returned.

如果发出的请求指定了所有属性,或者请求的属性未提供语言代码,则返回所有属性值,而不管其语言代码如何。

For example, if the client requests a "description" attribute, and a matching entry contains

例如,如果客户端请求一个“description”属性,并且匹配的条目包含

   objectclass: top
   objectclass: organization
   O: Software GmbH
   description: software
   description;lang-en: software products
   description;lang-de: Softwareprodukte
   postalAddress: Berlin 8001 Germany
   postalAddress;lang-de: Berlin 8001 Deutschland
        
   objectclass: top
   objectclass: organization
   O: Software GmbH
   description: software
   description;lang-en: software products
   description;lang-de: Softwareprodukte
   postalAddress: Berlin 8001 Germany
   postalAddress;lang-de: Berlin 8001 Deutschland
        

The server will return:

服务器将返回:

   description: software
   description;lang-en: software products
   description;lang-de: Softwareprodukte
        
   description: software
   description;lang-en: software products
   description;lang-de: Softwareprodukte
        
3.6. Add Operation
3.6. 添加操作

Clients MAY provide language codes in AttributeDescription in attributes of a new entry to be created, subject to the limitation that the client MUST NOT use language codes in the attribute value or values which form the RDN of the entry.

客户端可以在属性中提供语言代码在要创建的新条目的属性中描述,但受限于客户端不得在构成条目RDN的属性值或值中使用语言代码。

A client MAY provide multiple attributes with the same attribute type and value, so long as each attribute has a different language code, and at most one attribute does not have a language code option.

客户机可以提供具有相同属性类型和值的多个属性,只要每个属性具有不同的语言代码,并且最多一个属性没有语言代码选项。

Servers which support storing language codes in the DIT MUST allow any attribute it recognizes that has the Directory String syntax to have a language option associated with it. Servers SHOULD allow language options to be associated with other attributes.

支持在DIT中存储语言代码的服务器必须允许其识别的具有目录字符串语法的任何属性具有与其关联的语言选项。服务器应允许语言选项与其他属性关联。

For example, the following is a legal request.

例如,以下是一项法律请求。

   objectclass: top
   objectclass: person
   objectclass: residentialPerson
   name: John Smith
   CN: John Smith
   CN;lang-en: John Smith
   SN: Smith
   streetAddress: 1 University Street
   streetAddress;lang-en: 1 University Street
   streetAddress;lang-fr: 1 rue Universite
   houseIdentifier;lang-fr: 9e etage
        
   objectclass: top
   objectclass: person
   objectclass: residentialPerson
   name: John Smith
   CN: John Smith
   CN;lang-en: John Smith
   SN: Smith
   streetAddress: 1 University Street
   streetAddress;lang-en: 1 University Street
   streetAddress;lang-fr: 1 rue Universite
   houseIdentifier;lang-fr: 9e etage
        

If a server does not support storing language codes with attribute values in the DIT, then it MUST treat an AttributeDescription with a language code as an unrecognized attribute. If the server forbids the addition of unrecognized attributes then it MUST fail the add request with the appropriate result code.

如果服务器不支持在DIT中存储带有属性值的语言代码,则必须将带有语言代码的AttributeDescription视为无法识别的属性。如果服务器禁止添加无法识别的属性,则必须使用相应的结果代码使添加请求失败。

3.7. Modify Operation
3.7. 修改操作

A client MAY provide a language code in an AttributeDescription as part of a modification element in the modify operation.

客户端可以在AttributeDescription中提供语言代码,作为修改操作中修改元素的一部分。

Attribute types and language codes MUST match exactly against values stored in the directory. For example, if the modification is a "delete", then if the stored values to be deleted have a language code, the language code MUST be provided in the modify operation, and if the stored values to be deleted do not have a language code, then no language code is to be provided.

属性类型和语言代码必须与目录中存储的值完全匹配。例如,如果修改是“删除”,则如果要删除的存储值具有语言代码,则必须在修改操作中提供语言代码,如果要删除的存储值没有语言代码,则不提供语言代码。

If the server does not support storing language codes with attribute values in the DIT, then it MUST treat an AttributeDescription with a language code as an unrecognized attribute, and MUST fail the request with an appropriate result code.

如果服务器不支持在DIT中存储带有属性值的语言代码,则必须将带有语言代码的AttributeDescription视为无法识别的属性,并且必须使用适当的结果代码使请求失败。

3.8. Diagnostic Messages
3.8. 诊断信息

Servers SHOULD use only printable ASCII characters in the errorMessage field, as not all clients will be able to display the full range of Unicode.

服务器应在errorMessage字段中仅使用可打印的ASCII字符,因为并非所有客户端都能显示全部Unicode字符。

4. Differences from X.500(1997)
4. 与X.500(1997年)的差异

X.500(1997) defines a different mechanism, contexts, as the means of representing language tags. This section summarizes the major differences in approach.

X.500(1997)定义了一种不同的机制,即上下文,作为表示语言标记的手段。本节总结了方法上的主要差异。

a) An X.500 operation which has specified a language code on a value matches a value in the directory without a language code. b) LDAP references RFC 1766, which allows for IANA registration of new tags. c) LDAP does not allow language codes in distinguished names. d) X.500 describes subschema administration procedures to allow language codes to be associated with particular attributes types.

a) 在值上指定语言代码的X.500操作与目录中没有语言代码的值匹配。b) LDAP引用RFC1766,它允许IANA注册新标记。c) LDAP不允许在可分辨名称中使用语言代码。d) X.500描述了允许语言代码与特定属性类型关联的子模式管理程序。

5. Security Considerations
5. 安全考虑

There are no known security considerations for this document. See the security considerations sections of [1] and [2] for security considerations of LDAP in general.

此文档没有已知的安全注意事项。有关LDAP的一般安全注意事项,请参见[1]和[2]的安全注意事项部分。

6. Acknowledgements
6. 致谢

This document is a product of the IETF ASID and LDAPEXT working groups. Martin Duerst provided many valuable comments on an earlier version of this document.

本文件是IETF ASID和LDAPEXT工作组的产品。Martin Duerst就本文件的早期版本提供了许多有价值的评论。

7. Bibliography
7. 参考文献

[1] Wahl, M., Howes, T. and S. Kille, "Lightweight Directory Access Protocol (v3)", RFC 2251, December 1997.

[1] Wahl,M.,Howes,T.和S.Kille,“轻量级目录访问协议(v3)”,RFC 2251,1997年12月。

[2] Wahl, M., Coulbeck, A., Howes, T. and S. Kille, "Lightweight X.500 Directory Access Protocol Attribute Syntax Definitions", RFC 2252, December 1997.

[2] Wahl,M.,Coulbeck,A.,Howes,T.和S.Kille,“轻量级X.500目录访问协议属性语法定义”,RFC2252,1997年12月。

[3] Alvestrand, H.,"Tags for the Identification of Languages", RFC 1766, March 1995.

[3] Alvestrand,H.,“语言识别标签”,RFC1766,1995年3月。

[4] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[4] Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

8. Authors' Addresses
8. 作者地址

Mark Wahl Innosoft International, Inc. 8911 Capital of Texas Hwy Suite 4140 Austin, TX 78759 USA

Mark Wahl Innosoft International,Inc.美国德克萨斯州奥斯汀市德克萨斯州高速公路首府8911号4140室,邮编78759

   EMail:  M.Wahl@innosoft.com
        
   EMail:  M.Wahl@innosoft.com
        

Tim Howes Netscape Communications Corp. 501 E. Middlefield Rd Mountain View, CA 94043 USA

Tim Howes Netscape Communications Corp.美国加利福尼亚州山景城米德菲尔德东路501号,邮编94043

   Phone:  +1 650 937-3419
   EMail:   howes@netscape.com
        
   Phone:  +1 650 937-3419
   EMail:   howes@netscape.com
        

Full Copyright Statement

完整版权声明

Copyright (C) The Internet Society (1999). All Rights Reserved.

版权所有(C)互联网协会(1999年)。版权所有。

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

本文件及其译本可复制并提供给他人,对其进行评论或解释或协助其实施的衍生作品可全部或部分编制、复制、出版和分发,不受任何限制,前提是上述版权声明和本段包含在所有此类副本和衍生作品中。但是,不得以任何方式修改本文件本身,例如删除版权通知或对互联网协会或其他互联网组织的引用,除非出于制定互联网标准的需要,在这种情况下,必须遵循互联网标准过程中定义的版权程序,或根据需要将其翻译成英语以外的其他语言。

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

上述授予的有限许可是永久性的,互联网协会或其继承人或受让人不会撤销。

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

本文件和其中包含的信息是按“原样”提供的,互联网协会和互联网工程任务组否认所有明示或暗示的保证,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。

Acknowledgement

确认

Funding for the RFC Editor function is currently provided by the Internet Society.

RFC编辑功能的资金目前由互联网协会提供。