RFC 4646 - Tags for Identifying Languages(2)

时间:2006-11-02 来源: 作者: 点击:
CountryorAreaCodesforStatisticalUse[UN_M.49]or assignmentssubsequentlymadebythegoverningstandardsbody. NotethatnotalloftheUNM.49codesaredefinedintheIANA registry.Thefollowingrulesdefinewhichcodesaree
  
       Country or Area Codes for Statistical Use [UN_M.49] or
       assignments subsequently made by the governing standards body.
       Note that not all of the UN M.49 codes are defined in the IANA
       registry.  The following rules define which codes are entered
       into the registry as valid subtags:

       A.  UN numeric codes assigned to ’macro-geographical
           (continental)’ or sub-regions MUST be registered in the
           registry.  These codes are not associated with an assigned
           ISO 3166 alpha-2 code and represent supra-national areas,
           usually covering more than one nation, state, province, or
           territory.

       B.  UN numeric codes for ’economic groupings’ or ’other
           groupings’ MUST NOT be registered in the IANA registry and
           MUST NOT be used to form language tags.

       C.  UN numeric codes for countries or areas with ambiguous ISO
           3166 alpha-2 codes, when entered into the registry, MUST be
           defined according to the rules in Section 3.4 and MUST be
           used to form language tags that represent the country or
           region for which they are defined.

       D.  UN numeric codes for countries or areas for which there is an
           associated ISO 3166 alpha-2 code in the registry MUST NOT be
           entered into the registry and MUST NOT be used to form
           language tags.  Note that the ISO 3166-based subtag in the
           registry MUST actually be associated with the UN M.49 code in
           question.

       E.  UN numeric codes and ISO 3166 alpha-2 codes for countries or
           areas listed as eligible for registration in [RFC4645] but
           not presently registered MAY be entered into the IANA
           registry via the process described in Section 3.5.  Once
           registered, these codes MAY be used to form language tags.

       F.  All other UN numeric codes for countries or areas that do not
           have an associated ISO 3166 alpha-2 code MUST NOT be entered
           into the registry and MUST NOT be used to form language tags.
           For more information about these codes, see Section 3.4.

   4.  Note: The alphanumeric codes in Appendix X of the UN document
       MUST NOT be entered into the registry and MUST NOT be used to
       form language tags.  (At the time this document was created,
       these values matched the ISO 3166 alpha-2 codes.)

   5.  There MUST be at most one region subtag in a language tag and the
       region subtag MAY be omitted, as when it adds no distinguishing
       value to the tag.

   6.  The region subtags ’AA’, ’QM’-’QZ’, ’XA’-’XZ’, and ’ZZ’ are
       reserved for private use in language tags.  These subtags
       correspond to codes reserved by ISO 3166 for private use.  These
       codes MAY be used for private use region subtags (instead of
       using a private use subtag sequence).  Please refer to
       Section 4.5 for more information on private use subtags.

   "de-CH" represents German (’de’) as used in Switzerland (’CH’).

   "sr-Latn-CS" represents Serbian (’sr’) written using Latin script
   (’Latn’) as used in Serbia and Montenegro (’CS’).

   "es-419" represents Spanish (’es’) appropriate to the UN-defined
   Latin America and Caribbean region (’419’).

2.2.5.  Variant Subtags

   Variant subtags are used to indicate additional, well-recognized
   variations that define a language or its dialects that are not
   covered by other available subtags.  The following rules apply to the
   variant subtags:

   1.  Variant subtags are not associated with any external standard.
       Variant subtags and their meanings are defined by the
       registration process defined in Section 3.5.

   2.  Variant subtags MUST follow all of the other defined subtags, but
       precede any extension or private use subtag sequences.

   3.  More than one variant MAY be used to form the language tag.

   4.  Variant subtags MUST be registered with IANA according to the
       rules in Section 3.5 of this document before being used to form
       language tags.  In order to distinguish variants from other types
       of subtags, registrations MUST meet the following length and
       content restrictions:

       1.  Variant subtags that begin with a letter (a-z, A-Z) MUST be
           at least five characters long.

       2.  Variant subtags that begin with a digit (0-9) MUST be at
           least four characters long.

   Variant subtag records in the language subtag registry MAY include
   one or more ’Prefix’ fields, which indicate the language tag or tags
   that would make a suitable prefix (with other subtags, as
   appropriate) in forming a language tag with the variant.  For
   example, the subtag ’nedis’ has a Prefix of "sl", making it suitable
   to form language tags such as "sl-nedis" and "sl-IT-nedis", but not
   suitable for use in a tag such as "zh-nedis" or "it-IT-nedis".

   "sl-nedis" represents the Natisone or Nadiza dialect of Slovenian.

   "de-CH-1996" represents German as used in Switzerland and as written
   using the spelling reform beginning in the year 1996 C.E.

   Most variants that share a prefix are mutually exclusive.  For
   example, the German orthographic variations ’1996’ and ’1901’ SHOULD
   NOT be used in the same tag, as they represent the dates of different
   spelling reforms.  A variant that can meaningfully be used in
   combination with another variant SHOULD include a ’Prefix’ field in
   its registry record that lists that other variant.  For example, if
   another German variant ’example’ were created that made sense to use
   with ’1996’, then ’example’ should include two Prefix fields: "de"
   and "de-1996".

2.2.6.  Extension Subtags

   Extensions provide a mechanism for extending language tags for use in
   various applications.  See Section 3.7.  The following rules apply to
   extensions:

   1.   Extension subtags are separated from the other subtags defined
        in this document by a single-character subtag ("singleton").
        The singleton MUST be one allocated to a registration authority
        via the mechanism described in Section 3.7 and MUST NOT be the
        letter ’x’, which is reserved for private use subtag sequences.

   2.   Note: Private use subtag sequences starting with the singleton
        subtag ’x’ are described in Section 2.2.7 below.

   3.   An extension MUST follow at least a primary language subtag.
        That is, a language tag cannot begin with an extension.
        Extensions extend language tags, they do not override or replace
        them.  For example, "a-value" is not a well-formed language tag,
        while "de-a-value" is.

   4.   Each singleton subtag MUST appear at most one time in each tag
        (other than as a private use subtag).  That is, singleton
        subtags MUST NOT be repeated.  For example, the tag
        "en-a-bbb-a-ccc" is invalid because the subtag ’a’ appears
        twice.  Note that the tag "en-a-bbb-x-a-ccc" is valid because
        the second appearance of the singleton ’a’ is in a private use
        sequence.

   5.   Extension subtags MUST meet all of the requirements for the
        content and format of subtags defined in this document.

   6.   Extension subtags MUST meet whatever requirements are set by the
        document that defines their singleton prefix and whatever
        requirements are provided by the maintaining authority.

   7.   Each extension subtag MUST be from two to eight characters long
        and consist solely of letters or digits, with each subtag
        separated by a single ’-’.

   8.   Each singleton MUST be followed by at least one extension
        subtag.  For example, the tag "tlh-a-b-foo" is invalid because
        the first singleton ’a’ is followed immediately by another
        singleton ’b’.

   9.   Extension subtags MUST follow all language, extended language,
        script, region, and variant subtags in a tag.

   10.  All subtags following the singleton and before another singleton
        are part of the extension.  Example: In the tag "fr-a-Latn", the
        subtag ’Latn’ does not represent the script subtag ’Latn’
        defined in the IANA Language Subtag Registry.  Its meaning is
        defined by the extension ’a’.

   11.  In the event that more than one extension appears in a single
        tag, the tag SHOULD be canonicalized as described in
        Section 4.4.

   For example, if the prefix singleton ’r’ and the shown subtags were
   defined, then the following tag would be a valid example:
   "en-Latn-GB-boont-r-extended-sequence-x-private".

2.2.7.  Private Use Subtags

   Private use subtags are used to indicate distinctions in language
   important in a given context by private agreement.  The following
   rules apply to private use subtags:

   1.  Private use subtags are separated from the other subtags defined
       in this document by the reserved single-character subtag ’x’.

   2.  Private use subtags MUST conform to the format and content
       constraints defined in the ABNF for all subtags.

   3.  Private use subtags MUST follow all language, extended language,
       script, region, variant, and extension subtags in the tag.
       Another way of saying this is that all subtags following the
       singleton ’x’ MUST be considered private use.  Example: The
       subtag ’US’ in the tag "en-x-US" is a private use subtag.

   4.  A tag MAY consist entirely of private use subtags.

   5.  No source is defined for private use subtags.  Use of private use
       subtags is by private agreement only.

   6.  Private use subtags are NOT RECOMMENDED where alternatives exist
       or for general interchange.  See Section 4.5 for more information
       on private use subtag choice.

   For example: Users who wished to utilize codes from the Ethnologue
   publication of SIL International for language identification might
   agree to exchange tags such as "az-Arab-x-AZE-derbend".  This example
   contains two private use subtags.  The first is ’AZE’ and the second
   is ’derbend’.

2.2.8.  Preexisting RFC 3066 Registrations

   Existing IANA-registered language tags from RFC 1766 and/or RFC 3066
   maintain their validity.  These tags will be maintained in the
   registry in records of either the "grandfathered" or "redundant"
   type.  Grandfathered tags contain one or more subtags that are not
   defined in the Language Subtag Registry (see Section 3).  Redundant
   tags consist entirely of subtags defined above and whose independent
   registration is superseded by this document.  For more information,
   see Section 3.8.

   It is important to note that all language tags formed under the
   guidelines in this document were either legal, well-formed tags or
   could have been registered under RFC 3066.

2.2.9.  Classes of Conformance

   Implementations sometimes need to describe their capabilities with
   regard to the rules and practices described in this document.  There
   are two classes of conforming implementations described by this
   document: "well-formed" processors and "validating" processors.
   Claims of conformance SHOULD explicitly reference one of these
   definitions.

   An implementation that claims to check for well-formed language tags
   MUST:

   o  Check that the tag and all of its subtags, including extension and
      private use subtags, conform to the ABNF or that the tag is on the
      list of grandfathered tags.

   o  Check that singleton subtags that identify extensions do not
      repeat.  For example, the tag "en-a-xx-b-yy-a-zz" is not well-
      formed.

   Well-formed processors are strongly encouraged to implement the
   canonicalization rules contained in Section 4.4.

   An implementation that claims to be validating MUST:

   o  Check that the tag is well-formed.

   o  Specify the particular registry date for which the implementation
      performs validation of subtags.

   o  Check that either the tag is a grandfathered tag, or that all
      language, script, region, and variant subtags consist of valid
      codes for use in language tags according to the IANA registry as
      of the particular date specified by the implementation.

   o  Specify which, if any, extension RFCs as defined in Section 3.7
      are supported, including version, revision, and date.

   o  For any such extensions supported, check that all subtags used in
      that extension are valid.

   o  For variant and extended language subtags, if the registry
      contains one or more ’Prefix’ fields for that subtag, check that
      the tag matches at least one prefix.  The tag matches if all the

      subtags in the ’Prefix’ also appear in the tag.  For example, the
      prefix "es-CO" matches the tag "es-Latn-CO-x-private" because both
      the ’es’ language subtag and ’CO’ region subtag appear in the tag.

3.  Registry Format and Maintenance

   This section defines the Language Subtag Registry and the maintenance
   and update procedures associated with it, as well as a registry for
   extensions to language tags (Section 3.7).

   The Language Subtag Registry contains a comprehensive list of all of
   the subtags valid in language tags.  This allows implementers a
   straightforward and reliable way to validate language tags.  The
   Language Subtag Registry will be maintained so that, except for
   extension subtags, it is possible to validate all of the subtags that
   appear in a language tag under the provisions of this document or its
   revisions or successors.  In addition, the meaning of the various
   subtags will be unambiguous and stable over time.  (The meaning of
   private use subtags, of course, is not defined by the IANA registry.)

3.1.  Format of the IANA Language Subtag Registry

   The IANA Language Subtag Registry ("the registry") consists of a text
   file that is machine readable in the format described in this
   section, plus copies of the registration forms approved in accordance
   with the process described in Section 3.5.  The existing registration
   forms for grandfathered and redundant tags taken from RFC 3066 will
   be maintained as part of the obsolete RFC 3066 registry.  The
   remaining set of initial subtags will not have registration forms
   created for them.

   The registry is in the text format described below.  This format was
   based on the record-jar format described in [record-jar].

   Each line of text is limited to 72 characters, including all
   whitespace.  Records are separated by lines containing only the
   sequence "%%" (%x25.25).

   Each field can be viewed as a single, logical line of ASCII
   characters, comprising a field-name and a field-body separated by a
   COLON character (%x3A).  For convenience, the field-body portion of
   this conceptual entity can be split into a multiple-line
   representation; this is called "folding".  The format of the registry
   is described by the following ABNF (per [RFC4234]):

   registry   = record *("%%" CRLF record)
   record     = 1*( field-name *SP ":" *SP field-body CRLF )
   field-name = (ALPHA / DIGIT) [*(ALPHA / DIGIT / "-") (ALPHA / DIGIT)]
   field-body = *(ASCCHAR/LWSP)
   ASCCHAR    = %x21-25 / %x27-7E / UNICHAR ; Note: AMPERSAND is %x26
   UNICHAR    = "&#x" 2*6HEXDIG ";"

                      Figure 2: Registry Format ABNF

   The sequence ’..’ (%x2E.2E) in a field-body denotes a range of
   values.  Such a range represents all subtags of the same length that
   are in alphabetic or numeric order within that range, including the
   values explicitly mentioned.  For example ’a..c’ denotes the values
   ’a’, ’b’, and ’c’ and ’11..13’ denotes the values ’11’, ’12’, and
   ’13’.

   Characters from outside the US-ASCII [ISO646] repertoire, as well as
   the AMPERSAND character ("&", %x26) when it occurs in a field-body,
   are represented by a "Numeric Character Reference" using hexadecimal
   notation in the style used by [XML10] (see
   <http://www.w3.org/TR/REC-xml/#dt-charref>).  This consists of the
   sequence "&#x" (%x26.23.78) followed by a hexadecimal representation
   of the character’s code point in [ISO10646] followed by a closing
   semicolon (%x3B).  For example, the EURO SIGN, U+20AC, would be
   represented by the sequence "&#x20AC;".  Note that the hexadecimal
   notation MAY have between two and six digits.

   All fields whose field-body contains a date value use the "full-date"
   format specified in [RFC3339].  For example: "2004-06-28" represents
   June 28, 2004, in the Gregorian calendar.

   The first record in the file contains the single field whose field-
   name is "File-Date" (see Figure 3).  The field-body of this record
   contains the last modification date of this copy of the registry,
   making it possible to compare different versions of the registry.
   The registry on the IANA website is the most current.  Versions with
   an older date than that one are not up-to-date.

   File-Date: 2004-06-28
   %%

                 Figure 3: Example of the File-Date Record

   Subsequent records represent subtags in the registry.  Each of the
   fields in each record MUST occur no more than once, unless otherwise
   noted below.  Each record MUST contain the following fields:

   o  ’Type’

      *  Type’s field-value MUST consist of one of the following
         strings: "language", "extlang", "script", "region", "variant",
         "grandfathered", and "redundant" and denotes the type of tag or
         subtag.

   o  Either ’Subtag’ or ’Tag’

      *  Subtag’s field-value contains the subtag being defined.  This
         field MUST only appear in records of whose ’Type’ has one of
         these values: "language", "extlang", "script", "region", or
         "variant".

      *  Tag’s field-value contains a complete language tag.  This field
         MUST only appear in records whose ’Type’ has one of these
         values: "grandfathered" or "redundant".  Note that the field-
         value will always follow the ’grandfathered’ production in the
         ABNF in Section 2.1

   o  Description

      *  Description’s field-value contains a non-normative description
         of the subtag or tag.

   o  Added

      *  Added’s field-value contains the date the record was added to
         the registry.

   The ’Subtag’ or ’Tag’ field MUST use lowercase letters to form the
   subtag or tag, with two exceptions.  Subtags whose ’Type’ field is
   ’script’ (in other words, subtags defined by ISO 15924) MUST use
   titlecase.  Subtags whose ’Type’ field is ’region’ (in other words,
   subtags defined by ISO 3166) MUST use uppercase.  These exceptions
   mirror the use of case in the underlying standards.

   The field ’Description’ MAY appear more than one time and contains a
   description of the tag or subtag in the record.  At least one of the
   ’Description’ fields MUST be written or transcribed into the Latin
   script; the same or additional fields MAY also include a description
   in a non-Latin script.  The ’Description’ field is used for
   identification purposes and SHOULD NOT be taken to represent the
   actual native name of the language or variation or to be in any
   particular language.  Most descriptions are taken directly from
   source standards such as ISO 639 or ISO 3166.

   Note: Descriptions in registry entries that correspond to ISO 639,
   ISO 15924, ISO 3166, or UN M.49 codes are intended only to indicate
   the meaning of that identifier as defined in the source standard at
   the time it was added to the registry.  The description does not
   replace the content of the source standard itself.  The descriptions
   are not intended to be the English localized names for the subtags.
   Localization or translation of language tag and subtag descriptions
   is out of scope of this document.

   Each record MAY also contain the following fields:

   o  Preferred-Value

      *  For fields of type ’language’, ’extlang’, ’script’, ’region’,
         and ’variant’, ’Preferred-Value’ contains the subtag of the
         same ’Type’ that is preferred for forming the language tag.

      *  For fields of type ’grandfathered’ and ’redundant’, a canonical
         mapping to a complete language tag.

   o  Deprecated

      *  Deprecated’s field-value contains the date the record was
         deprecated.

   o  Prefix

      *  Prefix’s field-value contains a language tag with which this
         subtag MAY be used to form a new language tag, perhaps with
         other subtags as well.  This field MUST only appear in records
         whose ’Type’ field-value is ’variant’ or ’extlang’.  For
         example, the ’Prefix’ for the variant ’nedis’ is ’sl’, meaning
         that the tags "sl-nedis" and "sl-IT-nedis" might be appropriate
         while the tag "is-nedis" is not.

   o  Comments

      *  Comments contains additional information about the subtag, as
         deemed appropriate for understanding the registry and
         implementing language tags using the subtag or tag.

   o  Suppress-Script

      *  Suppress-Script contains a script subtag that SHOULD NOT be
         used to form language tags with the associated primary language
         subtag.  This field MUST only appear in records whose ’Type’
         field-value is ’language’.  See Section 4.1.

   The field ’Deprecated’ MAY be added to any record via the maintenance
   process described in Section 3.3 or via the registration process
   described in Section 3.5.  Usually, the addition of a ’Deprecated’
   field is due to the action of one of the standards bodies, such as
   ISO 3166, withdrawing a code.  In some historical cases, it might not
   have been possible to reconstruct the original deprecation date.  For
   these cases, an approximate date appears in the registry.  Although
   valid in language tags, subtags and tags with a ’Deprecated’ field
   are deprecated and validating processors SHOULD NOT generate these
   subtags.  Note that a record that contains a ’Deprecated’ field and
   no corresponding ’Preferred-Value’ field has no replacement mapping.

   The field ’Preferred-Value’ contains a mapping between the record in
   which it appears and another tag or subtag.  The value in this field
   is STRONGLY RECOMMENDED as the best choice to represent the value of
   this record when selecting a language tag.  These values form three
   groups:

   1.  ISO 639 language codes that were later withdrawn in favor of
       other codes.  These values are mostly a historical curiosity.

   2.  ISO 3166 region codes that have been withdrawn in favor of a new
       code.  This sometimes happens when a country changes its name or
       administration in such a way that warrants a new region code.

   3.  Tags grandfathered from RFC 3066.  In many cases, these tags have
       become obsolete because the values they represent were later
       encoded by ISO 639.

   Records that contain a ’Preferred-Value’ field MUST also have a
   ’Deprecated’ field.  This field contains a date of deprecation.
   Thus, a language tag processor can use the registry to construct the
   valid, non-deprecated set of subtags for a given date.  In addition,
   for any given tag, a processor can construct the set of valid
   language tags that correspond to that tag for all dates up to the
------分隔线----------------------------
顶一下
(0)
0%
踩一下
(1)
100%
------分隔线----------------------------
最新评论 查看所有评论
发表评论 查看所有评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
推荐内容