Skip to content
RFC Editor - Official home of RFCs

RFC 5646: BCP 47: Tags for Identifying Languages

  • A. Phillips, Ed.,  
  • M. Davis, Ed.
Best Current Practice
Network Working Group                                   A. Phillips, Ed.
Request for Comments: 5646                                        Lab126
BCP: 47                                                    M. Davis, Ed.
Obsoletes:                                                    Google
Category: Best Current Practice                           September 2009


                     Tags for Identifying Languages

Abstract

   This document describes the structure, content, construction, and
   semantics of language tags for use in cases where it is desirable to
   indicate the language used in an information object.  It also
   describes how to register values for use in language tags and the
   creation of user-defined extensions for private interchange.

Status of This Memo

   This document specifies an Internet Best Current Practices for the
   Internet Community, and requests discussion and suggestions for
   improvements.  Distribution of this memo is unlimited.

Copyright Notice

   Copyright (c) 2009 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents in effect on the date of
   publication of this document (http://trustee.ietf.org/license-info).
   Please review these documents carefully, as they describe your rights
   and restrictions with respect to this document.

   This document may contain material from IETF Documents or IETF
   Contributions published or made publicly available before November
   10, 2008.  The person(s) controlling the copyright in some of this
   material may not have granted the IETF Trust the right to allow
   modifications of such material outside the IETF Standards Process.
   Without obtaining an adequate license from the person(s) controlling
   the copyright in such materials, this document may not be modified
   outside the IETF Standards Process, and derivative works of it may
   not be created outside the IETF Standards Process, except to format
   it for publication as an RFC or to translate it into languages other
   than English.






Phillips & Davis         Best Current Practice                  [Page 1]


                     Language Tags                September 2009


Table of Contents

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  3
   2.  The Language Tag . . . . . . . . . . . . . . . . . . . . . . .  4
     2.1.  Syntax . . . . . . . . . . . . . . . . . . . . . . . . . .  4
       2.1.1.  Formatting of Language Tags  . . . . . . . . . . . . .  6
     2.2.  Language Subtag Sources and Interpretation . . . . . . . .  8
       2.2.1.  Primary Language Subtag . . . . . . . . . . . . . . . . 9
       2.2.2.  Extended Language Subtags  . . . . . . . . . . . . . . 11
       2.2.3.  Script Subtag  . . . . . . . . . . . . . . . . . . . . 12
       2.2.4.  Region Subtag  . . . . . . . . . . . . . . . . . . . . 13
       2.2.5.  Variant Subtags  . . . . . . . . . . . . . . . . . . . 15
       2.2.6.  Extension Subtags  . . . . . . . . . . . . . . . . . . 16
       2.2.7.  Private Use Subtags  . . . . . . . . . . . . . . . . . 18
       2.2.8.  Grandfathered and Redundant Registrations  . . . . . . 18
       2.2.9.  Classes of Conformance . . . . . . . . . . . . . . . . 19
   3.  Registry Format and Maintenance  . . . . . . . . . . . . . . . 21
     3.1.  Format of the IANA Language Subtag Registry  . . . . . . . 21
       3.1.1.  File Format  . . . . . . . . . . . . . . . . . . . . . 21
       3.1.2.  Record and Field Definitions . . . . . . . . . . . . . 23
       3.1.3.  Type Field . . . . . . . . . . . . . . . . . . . . . . 26
       3.1.4.  Subtag and Tag Fields  . . . . . . . . . . . . . . . . 26
       3.1.5.  Description Field  . . . . . . . . . . . . . . . . . . 26
       3.1.6.  Deprecated Field . . . . . . . . . . . . . . . . . . . 28
       3.1.7.  Preferred-Value Field  . . . . . . . . . . . . . . . . 28
       3.1.8.  Prefix Field . . . . . . . . . . . . . . . . . . . . . 31
       3.1.9.  Suppress-Script Field  . . . . . . . . . . . . . . . . 32
       3.1.10. Macrolanguage Field  . . . . . . . . . . . . . . . . . 32
       3.1.11. Scope Field  . . . . . . . . . . . . . . . . . . . . . 33
       3.1.12. Comments Field . . . . . . . . . . . . . . . . . . . . 34
     3.2.  Language Subtag Reviewer . . . . . . . . . . . . . . . . . 35
     3.3.  Maintenance of the Registry  . . . . . . . . . . . . . . . 35
     3.4.  Stability of IANA Registry Entries . . . . . . . . . . . . 36
     3.5.  Registration Procedure for Subtags . . . . . . . . . . . . 41
     3.6.  Possibilities for Registration . . . . . . . . . . . . . . 46
     3.7.  Extensions and the Extensions Registry . . . . . . . . . . 49
     3.8.  Update of the Language Subtag Registry . . . . . . . . . . 52
     3.9.  Applicability of the Subtag Registry . . . . . . . . . . . 52
   4.  Formation and Processing of Language Tags  . . . . . . . . . . 53
     4.1.  Choice of Language Tag . . . . . . . . . . . . . . . . . . 53
       4.1.1.  Tagging Encompassed Languages  . . . . . . . . . . . . 58
       4.1.2.  Using Extended Language Subtags  . . . . . . . . . . . 59
     4.2.  Meaning of the Language Tag  . . . . . . . . . . . . . . . 61
     4.3.  Lists of Languages . . . . . . . . . . . . . . . . . . . . 63
     4.4.  Length Considerations  . . . . . . . . . . . . . . . . . . 63
       4.4.1.  Working with Limited Buffer Sizes  . . . . . . . . . . 64
       4.4.2.  Truncation of Language Tags  . . . . . . . . . . . . . 65
     4.5.  Canonicalization of Language Tags  . . . . . . . . . . . . 66



Phillips & Davis         Best Current Practice                  [Page 2]


                     Language Tags                September 2009


     4.6.  Considerations for Private Use Subtags . . . . . . . . . . 68
   5.  IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 69
     5.1.  Language Subtag Registry . . . . . . . . . . . . . . . . . 69
     5.2.  Extensions Registry  . . . . . . . . . . . . . . . . . . . 71
   6.  Security Considerations  . . . . . . . . . . . . . . . . . . . 71
   7.  Character Set Considerations . . . . . . . . . . . . . . . . . 72
   8.  Changes from   . . . . . . . . . . . . . . . . . . . . 73
   9.  References . . . . . . . . . . . . . . . . . . . . . . . . . . 76
     9.1.  Normative References . . . . . . . . . . . . . . . . . . . 76
     9.2.  Informative References . . . . . . . . . . . . . . . . . . 78
   Appendix A.  Examples of Language Tags (Informative) . . . . . . . 80
   Appendix B.  Examples of Registration Forms  . . . . . . . . . . . 82
   Appendix C.  Acknowledgements  . . . . . . . . . . . . . . . . . . 83

1.  Introduction

   Human beings on our planet have, past and present, used a number of
   languages.  There are many reasons why one would want to identify the
   language used when presenting or requesting information.

   The language of an information item or a user's language preferences
   often need to be identified so that appropriate processing can be
   applied.  For example, the user's language preferences in a Web
   browser can be used to select Web pages appropriately.  Language
   information can also be used to select among tools (such as
   dictionaries) to assist in the processing or understanding of content
   in different languages.  Knowledge about the particular language used
   by some piece of information content might be useful or even required
   by some types of processing, for example, spell-checking, computer-
   synthesized speech, Braille transcription, or high-quality print
   renderings.

   One means of indicating the language used is by labeling the
   information content with an identifier or "tag".  These tags can also
   be used to specify the user's preferences when selecting information
   content or to label additional attributes of content and associated
   resources.

   Sometimes language tags are used to indicate additional language
   attributes of content.  For example, indicating specific information
   about the dialect, writing system, or orthography used in a document
   or resource may enable the user to obtain information in a form that
   they can understand, or it can be important in processing or
   rendering the given content into an appropriate form or style.

   This document specifies a particular identifier mechanism (the
   language tag) and a registration function for values to be used to




Phillips & Davis         Best Current Practice                  [Page 3]


                     Language Tags                September 2009


   form tags.  It also defines a mechanism for private use values and
   future extensions.

   This document replaces [] (which obsoleted [] which, in
   turn, replaced []).  This document, in combination with
   [], comprises BCP 47.  For a list of changes in this document,
   see Section 8.

   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 [].

2.  The Language Tag

   Language tags are used to help identify languages, whether spoken,
   written, signed, or otherwise signaled, for the purpose of
   communication.  This includes constructed and artificial languages
   but excludes languages not intended primarily for human
   communication, such as programming languages.

2.1.  Syntax

   A language tag is composed from a sequence of one or more "subtags",
   each of which refines or narrows the range of language identified by
   the overall tag.  Subtags, in turn, are a sequence of alphanumeric
   characters (letters and digits), distinguished and separated from
   other subtags in a tag by a hyphen ("-", [Unicode] U+002D).

   There are different types of subtag, each of which is distinguished
   by length, position in the tag, and content: each subtag's type can
   be recognized solely by these features.  This makes it possible to
   extract and assign some semantic information to the subtags, even if
   the specific subtag values are not recognized.  Thus, a language tag
   processor need not have a list of valid tags or subtags (that is, a
   copy of some version of the IANA Language Subtag Registry) in order
   to perform common searching and matching operations.  The only
   exceptions to this ability to infer meaning from subtag structure are
   the grandfathered tags listed in the productions 'regular' and
   'irregular' below.  These tags were registered under [] and
   are a fixed list that can never change.

   The syntax of the language tag in ABNF [] is:

 Language-Tag  = langtag             ; normal language tags
               / privateuse          ; private use tag
               / grandfathered       ; grandfathered tags





Phillips & Davis         Best Current Practice                  [Page 4]


                     Language Tags                September 2009


 langtag       = language
                 ["-" script]
                 ["-" region]
                 *("-" variant)
                 *("-" extension)
                 ["-" privateuse]

 language      = 2*3ALPHA            ; shortest ISO 639 code
                 ["-" extlang]       ; sometimes followed by
                                     ; extended language subtags
               / 4ALPHA              ; or reserved for future use
               / 5*8ALPHA            ; or registered language subtag

 extlang       = 3ALPHA              ; selected ISO 639 codes
                 *2("-" 3ALPHA)      ; permanently reserved

 script        = 4ALPHA              ; ISO 15924 code

 region        = 2ALPHA              ; ISO 3166-1 code
               / 3DIGIT              ; UN M.49 code

 variant       = 5*8alphanum         ; registered variants
               / (DIGIT 3alphanum)

 extension     = singleton 1*("-" (2*8alphanum))

                                     ; Single alphanumerics
                                     ; "x" reserved for private use
 singleton     = DIGIT               ; 0 - 9
               / %x41-57             ; A - W
               / %x59-5A             ; Y - Z
               / %x61-77             ; a - w
               / %x79-7A             ; y - z

 privateuse    = "x" 1*("-" (1*8alphanum))

 grandfathered = irregular           ; non-redundant tags registered
               / regular             ; during the  era

 irregular     = "en-GB-oed"         ; irregular tags do not match
               / "i-ami"             ; the 'langtag' production and
               / "i-bnn"             ; would not otherwise be
               / "i-default"         ; considered 'well-formed'
               / "i-enochian"        ; These tags are all valid,
               / "i-hak"             ; but most are deprecated
               / "i-klingon"         ; in favor of more modern
               / "i-lux"             ; subtags or subtag
               / "i-mingo"           ; combination



Phillips & Davis         Best Current Practice                  [Page 5]


                     Language Tags                September 2009


               / "i-navajo"
               / "i-pwn"
               / "i-tao"
               / "i-tay"
               / "i-tsu"
               / "sgn-BE-FR"
               / "sgn-BE-NL"
               / "sgn-CH-DE"

 regular       = "art-lojban"        ; these tags match the 'langtag'
               / "cel-gaulish"       ; production, but their subtags
               / "no-bok"            ; are not extended language
               / "no-nyn"            ; or variant subtags: their meaning
               / "zh-guoyu"          ; is defined by their registration
               / "zh-hakka"          ; and all of these are deprecated
               / "zh-min"            ; in favor of a more modern
               / "zh-min-nan"        ; subtag or sequence of subtags
               / "zh-xiang"

 alphanum      = (ALPHA / DIGIT)     ; letters and numbers

                        Figure 1: Language Tag ABNF

   For examples of language tags, see Appendix A.

   All subtags have a maximum length of eight characters.  Whitespace is
   not permitted in a language tag.  There is a subtlety in the ABNF
   production 'variant': a variant starting with a digit has a minimum
   length of four characters, while those starting with a letter have a
   minimum length of five characters.

   Although [] refers to octets, the language tags described in
   this document are sequences of characters from the US-ASCII [ISO646]
   repertoire.  Language tags MAY be used in documents and applications
   that use other encodings, so long as these encompass the relevant
   part of the US-ASCII repertoire.  An example of this would be an XML
   document that uses the UTF-16LE [] encoding of [Unicode].

2.1.1.  Formatting of Language Tags

   At all times, language tags and their subtags, including private use
   and extensions, are to be treated as case insensitive: there exist
   conventions for the capitalization of some of the subtags, but these
   MUST NOT be taken to carry meaning.

   Thus, the tag "mn-Cyrl-MN" is not distinct from "MN-cYRL-mn" or "mN-
   cYrL-Mn" (or any other combination), and each of these variations




Phillips & Davis         Best Current Practice                  [Page 6]


                     Language Tags                September 2009


   conveys the same meaning: Mongolian written in the Cyrillic script as
   used in Mongolia.

   The ABNF syntax also does not distinguish between upper- and
   lowercase: the uppercase US-ASCII letters in the range 'A' through
   'Z' are always considered equivalent and mapped directly to their US-
   ASCII lowercase equivalents in the range 'a' through 'z'.  So the tag
   "I-AMI" is considered equivalent to that value "i-ami" in the
   'irregular' production.

   Although case distinctions do not carry meaning in language tags,
   consistent formatting and presentation of language tags will aid
   users.  The format of subtags in the registry is RECOMMENDED as the
   form to use in language tags.  This format generally corresponds to
   the common conventions for the various ISO standards from which the
   subtags are derived.

   These conventions include:

   o  [ISO639-1] recommends that language codes be written in lowercase
      ('mn' Mongolian).

   o  [ISO15924] recommends that script codes use lowercase with the
      initial letter capitalized ('Cyrl' Cyrillic).

   o  [ISO3166-1] recommends that country codes be capitalized ('MN'
      Mongolia).

   An implementation can reproduce this format without accessing the
   registry as follows.  All subtags, including extension and private
   use subtags, use lowercase letters with two exceptions: two-letter
   and four-letter subtags that neither appear at the start of the tag
   nor occur after singletons.  Such two-letter subtags are all
   uppercase (as in the tags "en-CA-x-ca" or "sgn-BE-FR") and four-
   letter subtags are titlecase (as in the tag "az-Latn-x-latn").

   Note: Case folding of ASCII letters in certain locales, unless
   carefully handled, sometimes produces non-ASCII character values.
   The Unicode Character Database file "SpecialCasing.txt"
   [SpecialCasing] defines the specific cases that are known to cause
   problems with this.  In particular, the letter 'i' (U+0069) in
   Turkish and Azerbaijani is uppercased to U+0130 (LATIN CAPITAL LETTER
   I WITH DOT ABOVE).  Implementers SHOULD specify a locale-neutral
   casing operation to ensure that case folding of subtags does not
   produce this value, which is illegal in language tags.  For example,
   if one were to uppercase the region subtag 'in' using Turkish locale
   rules, the sequence U+0130 U+004E would result, instead of the
   expected 'IN'.



Phillips & Davis         Best Current Practice                  [Page 7]


                     Language Tags                September 2009


2.2.  Language Subtag Sources and Interpretation

   The namespace of language tags and their subtags is administered by
   the Internet Assigned Numbers Authority (IANA) according to the rules
   in Section 5 of this document.  The Language Subtag Registry
   maintained by IANA is the source for valid subtags: other standards
   referenced in this section provide the source material for that
   registry.

   Terminology used in this document:

   o  "Tag" refers to a complete language tag, such as "sr-Latn-RS" or
      "az-Arab-IR".  Examples of tags in this document are enclosed in
      double-quotes ("en-US").

   o  "Subtag" refers to a specific section of a tag, delimited by a
      hyphen, such as the subtags 'zh', 'Hant', and 'CN' in the tag "zh-
      Hant-CN".  Examples of subtags in this document are enclosed in
      single quotes ('Hant').

   o  "Code" refers to values defined in external standards (and that
      are used as subtags in this document).  For example, 'Hant' is an
      [ISO15924] script code that was used to define the 'Hant' script
      subtag for use in a language tag.  Examples of codes in this
      document are enclosed in single quotes ('en', 'Hant').

   Language tags are designed so that each subtag type has unique length
   and content restrictions.  These make identification of the subtag's
   type possible, even if the content of the subtag itself is
   unrecognized.  This allows tags to be parsed and processed without
   reference to the latest version of the underlying standards or the
   IANA registry and makes the associated exception handling when
   parsing tags simpler.

   Some of the subtags in the IANA registry do not come from an
   underlying standard.  These can only appear in specific positions in
   a tag: they can only occur as primary language subtags or as variant
   subtags.

   Sequences of private use and extension subtags MUST occur at the end
   of the sequence of subtags and MUST NOT be interspersed with subtags
   defined elsewhere in this document.  These sequences are introduced
   by single-character subtags, which are reserved as follows:

   o  The single-letter subtag 'x' introduces a sequence of private use
      subtags.  The interpretation of any private use subtag is defined





Phillips & Davis         Best Current Practice                  [Page 8]


                     Language Tags                September 2009


      solely by private agreement and is not defined by the rules in
      this section or in any standard or registry defined in this
      document.

   o  The single-letter subtag 'i' is used by some grandfathered tags,
      such as "i-default", where it always appears in the first position
      and cannot be confused with an extension.

   o  All other single-letter and single-digit subtags are reserved to
      introduce standardized extension subtag sequences as described in
      Section 3.7.

2.2.1.  Primary Language Subtag

   The primary language subtag is the first subtag in a language tag and
   cannot be omitted, with two exceptions:

   o  The single-character subtag 'x' as the primary subtag indicates
      that the language tag consists solely of subtags whose meaning is
      defined by private agreement.  For example, in the tag "x-fr-CH",
      the subtags 'fr' and 'CH' do not represent the French language or
      the country of Switzerland (or any other value in the IANA
      registry) unless there is a private agreement in place to do so.
      See Section 4.6.

   o  The single-character subtag 'i' is used by some grandfathered tags
      (see Section 2.2.8) such as "i-klingon" and "i-bnn".  (Other
      grandfathered tags have a primary language subtag in their first
      position.)

   The following rules apply to the primary language subtag:

   1.  Two-character primary language subtags were defined in the IANA
       registry according to the assignments found in the standard "ISO
       639-1:2002, Codes for the representation of names of languages --
       Part 1: Alpha-2 code" [ISO639-1], or using assignments
       subsequently made by the ISO 639-1 registration authority (RA) or
       governing standardization bodies.

   2.  Three-character primary language subtags in the IANA registry
       were defined according to the assignments found in one of these
       additional ISO 639 parts or assignments subsequently made by the
       relevant ISO 639 registration authorities or governing
       standardization bodies:

       A.  "ISO 639-2:1998 - Codes for the representation of names of
           languages -- Part 2: Alpha-3 code - edition 1" [ISO639-2]




Phillips & Davis         Best Current Practice                  [Page 9]


                     Language Tags                September 2009


       B.  "ISO 639-3:2007 - Codes for the representation of names of
           languages -- Part 3: Alpha-3 code for comprehensive coverage
           of languages" [ISO639-3]

       C.  "ISO 639-5:2008 - Codes for the representation of names of
           languages -- Part 5: Alpha-3 code for language families and
           groups" [ISO639-5]

   3.  The subtags in the range 'qaa' through 'qtz' are reserved for
       private use in language tags.  These subtags correspond to codes
       reserved by ISO 639-2 for private use.  These codes MAY be used
       for non-registered primary language subtags (instead of using
       private use subtags following 'x-').  Please refer to Section 4.6
       for more information on private use subtags.

   4.  Four-character language subtags are reserved for possible future
       standardization.

   5.  Any language subtags of five to eight characters in length in the
       IANA registry were defined via the registration process in
       Section 3.5 and MAY be used to form the primary language subtag.
       An example of what such a registration might include is the
       grandfathered IANA registration "i-enochian".  The subtag
       'enochian' could be registered in the IANA registry as a primary
       language subtag (assuming that ISO 639 does not register this
       language first), making tags such as "enochian-AQ" and "enochian-
       Latn" valid.

       At the time this document was created, there were no examples of
       this kind of subtag.  Future registrations of this type are
       discouraged: an attempt to register any new proposed primary
       language MUST be made to the ISO 639 registration authority.
       Proposals rejected by the ISO 639 registration authority are
       unlikely to meet the criteria for primary language subtags and
       are thus unlikely to be registered.

   6.  Other values MUST NOT be assigned to the primary subtag except by
       revision or update of this document.

   When languages have both an ISO 639-1 two-character code and a three-
   character code (assigned by ISO 639-2, ISO 639-3, or ISO 639-5), only
   the ISO 639-1 two-character code is defined in the IANA registry.

   When a language has no ISO 639-1 two-character code and the ISO
   639-2/T (Terminology) code and the ISO 639-2/B (Bibliographic) code
   for that language differ, only the Terminology code is defined in the
   IANA registry.  At the time this document was created, all languages
   that had both kinds of three-character codes were also assigned a



Phillips & Davis         Best Current Practice                 [Page 10]


                     Language Tags                September 2009


   two-character code; it is expected that future assignments of this
   nature will not occur.

   In order to avoid instability in the canonical form of tags, if a
   two-character code is added to ISO 639-1 for a language for which a
   three-character code was already included in either ISO 639-2 or ISO
   639-3, the two-character code MUST NOT be registered.  See
   Section 3.4.

   For example, if some content were tagged with 'haw' (Hawaiian), which
   currently has no two-character code, the tag would not need to be
   changed if ISO 639-1 were to assign a two-character code to the
   Hawaiian language at a later date.

   To avoid these problems with versioning and subtag choice (as
   experienced during the transition between  and ), as
   well as to ensure the canonical nature of subtags defined by this
   document, the ISO 639 Registration Authority Joint Advisory Committee
   (ISO 639/RA-JAC) has included the following statement in
   [iso639.prin]:

      "A language code already in ISO 639-2 at the point of freezing ISO
      639-1 shall not later be added to ISO 639-1.  This is to ensure
      consistency in usage over time, since users are directed in
      Internet applications to employ the alpha-3 code when an alpha-2
      code for that language is not available."

2.2.2.  Extended Language Subtags

   Extended language subtags are used to identify certain specially
   selected languages that, for various historical and compatibility
   reasons, are closely identified with or tagged using an existing
   primary language subtag.  Extended language subtags are always used
   with their enclosing primary language subtag (indicated with a
   'Prefix' field in the registry) when used to form the language tag.
   All languages that have an extended language subtag in the registry
   also have an identical primary language subtag record in the
   registry.  This primary language subtag is RECOMMENDED for forming
   the language tag.  The following rules apply to the extended language
   subtags:

   1.  Extended language subtags consist solely of three-letter subtags.
       All extended language subtag records defined in the registry were
       defined according to the assignments found in [ISO639-3].
       Language collections and groupings, such as defined in
       [ISO639-5], are specifically excluded from being extended
       language subtags.




Phillips & Davis         Best Current Practice                 [Page 11]


                     Language Tags                September 2009


   2.  Extended language subtag records MUST include exactly one
       'Prefix' field indicating an appropriate subtag or sequence of
       subtags for that extended language subtag.

   3.  Extended language subtag records MUST include a 'Preferred-
       Value'.  The 'Preferred-Value' and 'Subtag' fields MUST be
       identical.

   4.  Although the ABNF production 'extlang' permits up to three
       extended language tags in the language tag, extended language
       subtags MUST NOT include another extended language subtag in
       their 'Prefix'.  That is, the second and third extended language
       subtag positions in a language tag are permanently reserved and
       tags that include those subtags in that position are, and will
       always remain, invalid.

   For example, the macrolanguage Chinese ('zh') encompasses a number of
   languages.  For compatibility reasons, each of these languages has
   both a primary and extended language subtag in the registry.  A few
   selected examples of these include Gan Chinese ('gan'), Cantonese
   Chinese ('yue'), and Mandarin Chinese ('cmn').  Each is encompassed
   by the macrolanguage 'zh' (Chinese).  Therefore, they each have the
   prefix "zh" in their registry records.  Thus, Gan Chinese is
   represented with tags beginning "zh-gan" or "gan", Cantonese with
   tags beginning either "yue" or "zh-yue", and Mandarin Chinese with
   "zh-cmn" or "cmn".  The language subtag 'zh' can still be used
   without an extended language subtag to label a resource as some
   unspecified variety of Chinese, while the primary language subtag
   ('gan', 'yue', 'cmn') is preferred to using the extended language
   form ("zh-gan", "zh-yue", "zh-cmn").

2.2.3.  Script Subtag

   Script subtags are used to indicate the script or writing system
   variations that distinguish the written forms of a language or its
   dialects.  The following rules apply to the script subtags:

   1.  Script subtags MUST follow any primary and extended language
       subtags and MUST precede any other type of subtag.

   2.  Script subtags consist of four letters and were defined according
       to the assignments found in [ISO15924] ("Information and
       documentation -- Codes for the representation of names of
       scripts"), or subsequently assigned by the ISO 15924 registration
       authority or governing standardization bodies.  Only codes
       assigned by ISO 15924 will be considered for registration.





Phillips & Davis         Best Current Practice                 [Page 12]


                     Language Tags                September 2009


   3.  The script subtags 'Qaaa' through 'Qabx' are reserved for private
       use in language tags.  These subtags correspond to codes reserved
       by ISO 15924 for private use.  These codes MAY be used for non-
       registered script values.  Please refer to Section 4.6 for more
       information on private use subtags.

   4.  There MUST be at most one script subtag in a language tag, and
       the script subtag SHOULD be omitted when it adds no
       distinguishing value to the tag or when the primary or extended
       language subtag's record in the subtag registry includes a
       'Suppress-Script' field listing the applicable script subtag.

   For example: "sr-Latn" represents Serbian written using the Latin
   script.

2.2.4.  Region Subtag

   Region subtags are used to indicate linguistic variations associated
   with or appropriate to a specific country, territory, or region.
   Typically, a region subtag is used to indicate variations such as
   regional dialects or usage, or region-specific spelling conventions.
   It can also be used to indicate that content is expressed in a way
   that is appropriate for use throughout a region, for instance,
   Spanish content tailored to be useful throughout Latin America.

   The following rules apply to the region subtags:

   1.  Region subtags MUST follow any primary language, extended
       language, or script subtags and MUST precede any other type of
       subtag.

   2.  Two-letter region subtags were defined according to the
       assignments found in [ISO3166-1] ("Codes for the representation
       of names of countries and their subdivisions -- Part 1: Country
       codes"), using the list of alpha-2 country codes or using
       assignments subsequently made by the ISO 3166-1 maintenance
       agency or governing standardization bodies.  In addition, the
       codes that are "exceptionally reserved" (as opposed to
       "assigned") in ISO 3166-1 were also defined in the registry, with
       the exception of 'UK', which is an exact synonym for the assigned
       code 'GB'.

   3.  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.6 for more information on private use subtags.



Phillips & Davis         Best Current Practice                 [Page 13]


                     Language Tags                September 2009


   4.  Three-character region subtags consist solely of digit (number)
       characters and were defined according to the assignments found in
       the UN Standard Country or Area Codes for Statistical  Use
       [UN_M.49] or assignments subsequently made by the governing
       standards body.  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-1 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.  When ISO 3166-1 reassigns a code formerly used for one
           country or area to another country or area and that code
           already is present in the registry, the UN numeric code for
           that country or area MUST be registered in the registry as
           described in Section 3.4 and MUST be used to form language
           tags that represent the country or region for which it is
           defined (rather than the recycled ISO 3166-1 code).

       D.  UN numeric codes for countries or areas for which there is an
           associated ISO 3166-1 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.  For historical reasons, the UN numeric code 830 (Channel
           Islands), which was not registered at the time this document
           was adopted and had, at that time, no corresponding ISO
           3166-1 code, MAY be entered into the IANA registry via the
           process described in Section 3.5, provided no ISO 3166-1 code
           with that exact meaning has been previously registered.

       F.  All other UN numeric codes for countries or areas that do not
           have an associated ISO 3166-1 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.





Phillips & Davis         Best Current Practice                 [Page 14]


                     Language Tags                September 2009


   5.  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-1 alpha-2 codes.)

   6.  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.

   For example:

      "de-AT" represents German ('de') as used in Austria ('AT').

      "sr-Latn-RS" represents Serbian ('sr') written using Latin script
      ('Latn') as used in Serbia ('RS').

      "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 MUST follow any primary language, extended
       language, script, or region subtags and MUST precede any
       extension or private use subtag sequences.

   2.  Variant subtags, as a collection, are not associated with any
       particular external standard.  The meaning of variant subtags in
       the registry is defined in the course of the registration process
       defined in