• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2[Note that this file is a concatenation of more than one RFC.]
3
4
5
6Network Working Group                                   A. Phillips, Ed.
7Request for Comments: 4646                                   Yahoo! Inc.
8BCP: 47                                                    M. Davis, Ed.
9Obsoletes: 3066                                                   Google
10Category: Best Current Practice                           September 2006
11
12
13                     Tags for Identifying Languages
14
15Status of This Memo
16
17   This document specifies an Internet Best Current Practices for the
18   Internet Community, and requests discussion and suggestions for
19   improvements.  Distribution of this memo is unlimited.
20
21Copyright Notice
22
23   Copyright (C) The Internet Society (2005).
24
25Abstract
26
27   This document describes the structure, content, construction, and
28   semantics of language tags for use in cases where it is desirable to
29   indicate the language used in an information object.  It also
30   describes how to register values for use in language tags and the
31   creation of user-defined extensions for private interchange.  This
32   document, in combination with RFC 4647, replaces RFC 3066, which
33   replaced RFC 1766.
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57Phillips & Davis         Best Current Practice                  [Page 1]
58
59RFC 4646             Tags for Identifying Languages       September 2006
60
61
62Table of Contents
63
64   1. Introduction ....................................................3
65   2. The Language Tag ................................................4
66      2.1. Syntax .....................................................4
67      2.2. Language Subtag Sources and Interpretation .................7
68           2.2.1. Primary Language Subtag .............................8
69           2.2.2. Extended Language Subtags ..........................10
70           2.2.3. Script Subtag ......................................11
71           2.2.4. Region Subtag ......................................11
72           2.2.5. Variant Subtags ....................................13
73           2.2.6. Extension Subtags ..................................14
74           2.2.7. Private Use Subtags ................................16
75           2.2.8. Preexisting RFC 3066 Registrations .................16
76           2.2.9. Classes of Conformance .............................17
77   3. Registry Format and Maintenance ................................18
78      3.1. Format of the IANA Language Subtag Registry ...............18
79      3.2. Language Subtag Reviewer ..................................24
80      3.3. Maintenance of the Registry ...............................24
81      3.4. Stability of IANA Registry Entries ........................25
82      3.5. Registration Procedure for Subtags ........................29
83      3.6. Possibilities for Registration ............................32
84      3.7. Extensions and Extensions Registry ........................34
85      3.8. Initialization of the Registries ..........................37
86   4. Formation and Processing of Language Tags ......................38
87      4.1. Choice of Language Tag ....................................38
88      4.2. Meaning of the Language Tag ...............................40
89      4.3. Length Considerations .....................................41
90           4.3.1. Working with Limited Buffer Sizes ..................42
91           4.3.2. Truncation of Language Tags ........................43
92      4.4. Canonicalization of Language Tags .........................44
93      4.5. Considerations for Private Use Subtags ....................45
94   5. IANA Considerations ............................................46
95      5.1. Language Subtag Registry ..................................46
96      5.2. Extensions Registry .......................................47
97   6. Security Considerations ........................................48
98   7. Character Set Considerations ...................................48
99   8. Changes from RFC 3066 ..........................................49
100   9. References .....................................................52
101      9.1. Normative References ......................................52
102      9.2. Informative References ....................................53
103   Appendix A. Acknowledgements ......................................55
104   Appendix B. Examples of Language Tags (Informative) ...............56
105
106
107
108
109
110
111
112
113Phillips & Davis         Best Current Practice                  [Page 2]
114
115RFC 4646             Tags for Identifying Languages       September 2006
116
117
1181.  Introduction
119
120   Human beings on our planet have, past and present, used a number of
121   languages.  There are many reasons why one would want to identify the
122   language used when presenting or requesting information.
123
124   A user's language preferences often need to be identified so that
125   appropriate processing can be applied.  For example, the user's
126   language preferences in a Web browser can be used to select Web pages
127   appropriately.  Language preferences can also be used to select among
128   tools (such as dictionaries) to assist in the processing or
129   understanding of content in different languages.
130
131   In addition, knowledge about the particular language used by some
132   piece of information content might be useful or even required by some
133   types of processing; for example, spell-checking, computer-
134   synthesized speech, Braille transcription, or high-quality print
135   renderings.
136
137   One means of indicating the language used is by labeling the
138   information content with an identifier or "tag".  These tags can be
139   used to specify user preferences when selecting information content,
140   or for labeling additional attributes of content and associated
141   resources.
142
143   Tags can also be used to indicate additional language attributes of
144   content.  For example, indicating specific information about the
145   dialect, writing system, or orthography used in a document or
146   resource may enable the user to obtain information in a form that
147   they can understand, or it can be important in processing or
148   rendering the given content into an appropriate form or style.
149
150   This document specifies a particular identifier mechanism (the
151   language tag) and a registration function for values to be used to
152   form tags.  It also defines a mechanism for private use values and
153   future extension.
154
155   This document, in combination with [RFC4647], replaces [RFC3066],
156   which replaced [RFC1766].  For a list of changes in this document,
157   see Section 8.
158
159   The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
160   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
161   document are to be interpreted as described in [RFC2119].
162
163
164
165
166
167
168
169Phillips & Davis         Best Current Practice                  [Page 3]
170
171RFC 4646             Tags for Identifying Languages       September 2006
172
173
1742.  The Language Tag
175
176   Language tags are used to help identify languages, whether spoken,
177   written, signed, or otherwise signaled, for the purpose of
178   communication.  This includes constructed and artificial languages,
179   but excludes languages not intended primarily for human
180   communication, such as programming languages.
181
1822.1.  Syntax
183
184   The language tag is composed of one or more parts, known as
185   "subtags".  Each subtag consists of a sequence of alphanumeric
186   characters.  Subtags are distinguished and separated from one another
187   by a hyphen ("-", ABNF [RFC4234] %x2D).  A language tag consists of a
188   "primary language" subtag and a (possibly empty) series of subsequent
189   subtags, each of which refines or narrows the range of languages
190   identified by the overall tag.
191
192   Usually, each type of subtag is distinguished by length, position in
193   the tag, and content: subtags can be recognized solely by these
194   features.  The only exception to this is a fixed list of
195   grandfathered tags registered under RFC 3066 [RFC3066].  This makes
196   it possible to construct a parser that can extract and assign some
197   semantic information to the subtags, even if the specific subtag
198   values are not recognized.  Thus, a parser need not have an up-to-
199   date copy (or any copy at all) of the subtag registry to perform most
200   searching and matching operations.
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225Phillips & Davis         Best Current Practice                  [Page 4]
226
227RFC 4646             Tags for Identifying Languages       September 2006
228
229
230   The syntax of the language tag in ABNF [RFC4234] is:
231
232   Language-Tag  = langtag
233                 / privateuse             ; private use tag
234                 / grandfathered          ; grandfathered registrations
235
236   langtag       = (language
237                    ["-" script]
238                    ["-" region]
239                    *("-" variant)
240                    *("-" extension)
241                    ["-" privateuse])
242
243   language      = (2*3ALPHA [ extlang ]) ; shortest ISO 639 code
244                 / 4ALPHA                 ; reserved for future use
245                 / 5*8ALPHA               ; registered language subtag
246
247   extlang       = *3("-" 3ALPHA)         ; reserved for future use
248
249   script        = 4ALPHA                 ; ISO 15924 code
250
251   region        = 2ALPHA                 ; ISO 3166 code
252                 / 3DIGIT                 ; UN M.49 code
253
254   variant       = 5*8alphanum            ; registered variants
255                 / (DIGIT 3alphanum)
256
257   extension     = singleton 1*("-" (2*8alphanum))
258
259   singleton     = %x41-57 / %x59-5A / %x61-77 / %x79-7A / DIGIT
260                 ; "a"-"w" / "y"-"z" / "A"-"W" / "Y"-"Z" / "0"-"9"
261                 ; Single letters: x/X is reserved for private use
262
263   privateuse    = ("x"/"X") 1*("-" (1*8alphanum))
264
265   grandfathered = 1*3ALPHA 1*2("-" (2*8alphanum))
266                   ; grandfathered registration
267                   ; Note: i is the only singleton
268                   ; that starts a grandfathered tag
269
270   alphanum      = (ALPHA / DIGIT)       ; letters and numbers
271
272                        Figure 1: Language Tag ABNF
273
274   Note: There is a subtlety in the ABNF for 'variant': variants
275   starting with a digit MAY be four characters long, while those
276   starting with a letter MUST be at least five characters long.
277
278
279
280
281Phillips & Davis         Best Current Practice                  [Page 5]
282
283RFC 4646             Tags for Identifying Languages       September 2006
284
285
286   All subtags have a maximum length of eight characters and whitespace
287   is not permitted in a language tag.  For examples of language tags,
288   see Appendix B.
289
290   Note that although [RFC4234] refers to octets, the language tags
291   described in this document are sequences of characters from the
292   US-ASCII [ISO646] repertoire.  Language tags MAY be used in documents
293   and applications that use other encodings, so long as these encompass
294   the US-ASCII repertoire.  An example of this would be an XML document
295   that uses the UTF-16LE [RFC2781] encoding of [Unicode].
296
297   The tags and their subtags, including private use and extensions, are
298   to be treated as case insensitive: there exist conventions for the
299   capitalization of some of the subtags, but these MUST NOT be taken to
300   carry meaning.
301
302   For example:
303
304   o  [ISO639-1] recommends that language codes be written in lowercase
305      ('mn' Mongolian).
306
307   o  [ISO3166-1] recommends that country codes be capitalized ('MN'
308      Mongolia).
309
310   o  [ISO15924] recommends that script codes use lowercase with the
311      initial letter capitalized ('Cyrl' Cyrillic).
312
313   However, in the tags defined by this document, the uppercase US-ASCII
314   letters in the range 'A' through 'Z' are considered equivalent and
315   mapped directly to their US-ASCII lowercase equivalents in the range
316   'a' through 'z'.  Thus, the tag "mn-Cyrl-MN" is not distinct from
317   "MN-cYRL-mn" or "mN-cYrL-Mn" (or any other combination), and each of
318   these variations conveys the same meaning: Mongolian written in the
319   Cyrillic script as used in Mongolia.
320
321   Although case distinctions do not carry meaning in language tags,
322   consistent formatting and presentation of the tags will aid users.
323   The format of the tags and subtags in the registry is RECOMMENDED.
324   In this format, all non-initial two-letter subtags are uppercase, all
325   non-initial four-letter subtags are titlecase, and all other subtags
326   are lowercase.
327
328
329
330
331
332
333
334
335
336
337Phillips & Davis         Best Current Practice                  [Page 6]
338
339RFC 4646             Tags for Identifying Languages       September 2006
340
341
3422.2.  Language Subtag Sources and Interpretation
343
344   The namespace of language tags and their subtags is administered by
345   the Internet Assigned Numbers Authority (IANA) [RFC2860] according to
346   the rules in Section 5 of this document.  The Language Subtag
347   Registry maintained by IANA is the source for valid subtags: other
348   standards referenced in this section provide the source material for
349   that registry.
350
351   Terminology in this section:
352
353   o  Tag or tags refers to a complete language tag, such as
354      "fr-Latn-CA".  Examples of tags in this document are enclosed in
355      double-quotes ("en-US").
356
357   o  Subtag refers to a specific section of a tag, delimited by hyphen,
358      such as the subtag 'Latn' in "fr-Latn-CA".  Examples of subtags in
359      this document are enclosed in single quotes ('Latn').
360
361   o  Code or codes refers to values defined in external standards (and
362      that are used as subtags in this document).  For example, 'Latn'
363      is an [ISO15924] script code that was used to define the 'Latn'
364      script subtag for use in a language tag.  Examples of codes in
365      this document are enclosed in single quotes ('en', 'Latn').
366
367   The definitions in this section apply to the various subtags within
368   the language tags defined by this document, excepting those
369   "grandfathered" tags defined in Section 2.2.8.
370
371   Language tags are designed so that each subtag type has unique length
372   and content restrictions.  These make identification of the subtag's
373   type possible, even if the content of the subtag itself is
374   unrecognized.  This allows tags to be parsed and processed without
375   reference to the latest version of the underlying standards or the
376   IANA registry and makes the associated exception handling when
377   parsing tags simpler.
378
379   Subtags in the IANA registry that do not come from an underlying
380   standard can only appear in specific positions in a tag.
381   Specifically, they can only occur as primary language subtags or as
382   variant subtags.
383
384   Note that sequences of private use and extension subtags MUST occur
385   at the end of the sequence of subtags and MUST NOT be interspersed
386   with subtags defined elsewhere in this document.
387
388   Single-letter and single-digit subtags are reserved for current or
389   future use.  These include the following current uses:
390
391
392
393Phillips & Davis         Best Current Practice                  [Page 7]
394
395RFC 4646             Tags for Identifying Languages       September 2006
396
397
398   o  The single-letter subtag 'x' is reserved to introduce a sequence
399      of private use subtags.  The interpretation of any private use
400      subtags is defined solely by private agreement and is not defined
401      by the rules in this section or in any standard or registry
402      defined in this document.
403
404   o  All other single-letter subtags are reserved to introduce
405      standardized extension subtag sequences as described in
406      Section 3.7.
407
408   The single-letter subtag 'i' is used by some grandfathered tags, such
409   as "i-enochian", where it always appears in the first position and
410   cannot be confused with an extension.
411
4122.2.1.  Primary Language Subtag
413
414   The primary language subtag is the first subtag in a language tag
415   (with the exception of private use and certain grandfathered tags)
416   and cannot be omitted.  The following rules apply to the primary
417   language subtag:
418
419   1.  All two-character language subtags were defined in the IANA
420       registry according to the assignments found in the standard ISO
421       639 Part 1, "ISO 639-1:2002, Codes for the representation of
422       names of languages -- Part 1: Alpha-2 code" [ISO639-1], or using
423       assignments subsequently made by the ISO 639 Part 1 maintenance
424       agency or governing standardization bodies.
425
426   2.  All three-character language subtags were defined in the IANA
427       registry according to the assignments found in ISO 639 Part 2,
428       "ISO 639-2:1998 - Codes for the representation of names of
429       languages -- Part 2: Alpha-3 code - edition 1" [ISO639-2], or
430       assignments subsequently made by the ISO 639 Part 2 maintenance
431       agency or governing standardization bodies.
432
433   3.  The subtags in the range 'qaa' through 'qtz' are reserved for
434       private use in language tags.  These subtags correspond to codes
435       reserved by ISO 639-2 for private use.  These codes MAY be used
436       for non-registered primary language subtags (instead of using
437       private use subtags following 'x-').  Please refer to Section 4.5
438       for more information on private use subtags.
439
440   4.  All four-character language subtags are reserved for possible
441       future standardization.
442
443   5.  All language subtags of 5 to 8 characters in length in the IANA
444       registry were defined via the registration process in Section 3.5
445       and MAY be used to form the primary language subtag.  At the time
446
447
448
449Phillips & Davis         Best Current Practice                  [Page 8]
450
451RFC 4646             Tags for Identifying Languages       September 2006
452
453
454       this document was created, there were no examples of this kind of
455       subtag and future registrations of this type will be discouraged:
456       primary languages are strongly RECOMMENDED for registration with
457       ISO 639, and proposals rejected by ISO 639/RA will be closely
458       scrutinized before they are registered with IANA.
459
460   6.  The single-character subtag 'x' as the primary subtag indicates
461       that the language tag consists solely of subtags whose meaning is
462       defined by private agreement.  For example, in the tag "x-fr-CH",
463       the subtags 'fr' and 'CH' SHOULD NOT be taken to represent the
464       French language or the country of Switzerland (or any other value
465       in the IANA registry) unless there is a private agreement in
466       place to do so.  See Section 4.5.
467
468   7.  The single-character subtag 'i' is used by some grandfathered
469       tags (see Section 2.2.8) such as "i-klingon" and "i-bnn".  (Other
470       grandfathered tags have a primary language subtag in their first
471       position.)
472
473   8.  Other values MUST NOT be assigned to the primary subtag except by
474       revision or update of this document.
475
476   Note: For languages that have both an ISO 639-1 two-character code
477   and an ISO 639-2 three-character code, only the ISO 639-1 two-
478   character code is defined in the IANA registry.
479
480   Note: For languages that have no ISO 639-1 two-character code and for
481   which the ISO 639-2/T (Terminology) code and the ISO 639-2/B
482   (Bibliographic) codes differ, only the Terminology code is defined in
483   the IANA registry.  At the time this document was created, all
484   languages that had both kinds of three-character code were also
485   assigned a two-character code; it is not expected that future
486   assignments of this nature will occur.
487
488   Note: To avoid problems with versioning and subtag choice as
489   experienced during the transition between RFC 1766 and RFC 3066, as
490   well as the canonical nature of subtags defined by this document, the
491   ISO 639 Registration Authority Joint Advisory Committee (ISO 639/
492   RA-JAC) has included the following statement in [iso639.prin]:
493
494   "A language code already in ISO 639-2 at the point of freezing ISO
495   639-1 shall not later be added to ISO 639-1.  This is to ensure
496   consistency in usage over time, since users are directed in Internet
497   applications to employ the alpha-3 code when an alpha-2 code for that
498   language is not available."
499
500
501
502
503
504
505Phillips & Davis         Best Current Practice                  [Page 9]
506
507RFC 4646             Tags for Identifying Languages       September 2006
508
509
510   In order to avoid instability in the canonical form of tags, if a
511   two-character code is added to ISO 639-1 for a language for which a
512   three-character code was already included in ISO 639-2, the two-
513   character code MUST NOT be registered.  See Section 3.4.
514
515   For example, if some content were tagged with 'haw' (Hawaiian), which
516   currently has no two-character code, the tag would not be invalidated
517   if ISO 639-1 were to assign a two-character code to the Hawaiian
518   language at a later date.
519
520   For example, one of the grandfathered IANA registrations is
521   "i-enochian".  The subtag 'enochian' could be registered in the IANA
522   registry as a primary language subtag (assuming that ISO 639 does not
523   register this language first), making tags such as "enochian-AQ" and
524   "enochian-Latn" valid.
525
5262.2.2.  Extended Language Subtags
527
528   The following rules apply to the extended language subtags:
529
530   1.  Three-letter subtags immediately following the primary subtag are
531       reserved for future standardization, anticipating work that is
532       currently under way on ISO 639.
533
534   2.  Extended language subtags MUST follow the primary subtag and
535       precede any other subtags.
536
537   3.  There MAY be up to three extended language subtags.
538
539   4.  Extended language subtags MUST NOT be registered or used to form
540       language tags.  Their syntax is described here so that
541       implementations can be compatible with any future revision of
542       this document that does provide for their registration.
543
544   Extended language subtag records, once they appear in the registry,
545   MUST include exactly one 'Prefix' field indicating an appropriate
546   language subtag or sequence of subtags that MUST always appear as a
547   prefix to the extended language subtag.
548
549   Example: In a future revision or update of this document, the tag
550   "zh-gan" (registered under RFC 3066) might become a valid non-
551   grandfathered (that is, redundant) tag in which the subtag 'gan'
552   might represent the Chinese dialect 'Gan'.
553
554
555
556
557
558
559
560
561Phillips & Davis         Best Current Practice                 [Page 10]
562
563RFC 4646             Tags for Identifying Languages       September 2006
564
565
5662.2.3.  Script Subtag
567
568   Script subtags are used to indicate the script or writing system
569   variations that distinguish the written forms of a language or its
570   dialects.  The following rules apply to the script subtags:
571
572   1.  All four-character subtags were defined according to
573       [ISO15924]--"Codes for the representation of names of scripts":
574       alpha-4 script codes, or subsequently assigned by the ISO 15924
575       maintenance agency or governing standardization bodies, denoting
576       the script or writing system used in conjunction with this
577       language.
578
579   2.  Script subtags MUST immediately follow the primary language
580       subtag and all extended language subtags and MUST occur before
581       any other type of subtag described below.
582
583   3.  The script subtags 'Qaaa' through 'Qabx' are reserved for private
584       use in language tags.  These subtags correspond to codes reserved
585       by ISO 15924 for private use.  These codes MAY be used for non-
586       registered script values.  Please refer to Section 4.5 for more
587       information on private use subtags.
588
589   4.  Script subtags MUST NOT be registered using the process in
590       Section 3.5 of this document.  Variant subtags MAY be considered
591       for registration for that purpose.
592
593   5.  There MUST be at most one script subtag in a language tag, and
594       the script subtag SHOULD be omitted when it adds no
595       distinguishing value to the tag or when the primary language
596       subtag's record includes a Suppress-Script field listing the
597       applicable script subtag.
598
599   Example: "sr-Latn" represents Serbian written using the Latin script.
600
6012.2.4.  Region Subtag
602
603   Region subtags are used to indicate linguistic variations associated
604   with or appropriate to a specific country, territory, or region.
605   Typically, a region subtag is used to indicate regional dialects or
606   usage, or region-specific spelling conventions.  A region subtag can
607   also be used to indicate that content is expressed in a way that is
608   appropriate for use throughout a region, for instance, Spanish
609   content tailored to be useful throughout Latin America.
610
611
612
613
614
615
616
617Phillips & Davis         Best Current Practice                 [Page 11]
618
619RFC 4646             Tags for Identifying Languages       September 2006
620
621
622   The following rules apply to the region subtags:
623
624   1.  Region subtags MUST follow any language, extended language, or
625       script subtags and MUST precede all other subtags.
626
627   2.  All two-character subtags following the primary subtag were
628       defined in the IANA registry according to the assignments found
629       in [ISO3166-1] ("Codes for the representation of names of
630       countries and their subdivisions -- Part 1: Country codes") using
631       the list of alpha-2 country codes, or using assignments
632       subsequently made by the ISO 3166 maintenance agency or governing
633       standardization bodies.
634
635   3.  All three-character subtags consisting of digit (numeric)
636       characters following the primary subtag were defined in the IANA
637       registry according to the assignments found in UN Standard
638       Country or Area Codes for Statistical Use [UN_M.49] or
639       assignments subsequently made by the governing standards body.
640       Note that not all of the UN M.49 codes are defined in the IANA
641       registry.  The following rules define which codes are entered
642       into the registry as valid subtags:
643
644       A.  UN numeric codes assigned to 'macro-geographical
645           (continental)' or sub-regions MUST be registered in the
646           registry.  These codes are not associated with an assigned
647           ISO 3166 alpha-2 code and represent supra-national areas,
648           usually covering more than one nation, state, province, or
649           territory.
650
651       B.  UN numeric codes for 'economic groupings' or 'other
652           groupings' MUST NOT be registered in the IANA registry and
653           MUST NOT be used to form language tags.
654
655       C.  UN numeric codes for countries or areas with ambiguous ISO
656           3166 alpha-2 codes, when entered into the registry, MUST be
657           defined according to the rules in Section 3.4 and MUST be
658           used to form language tags that represent the country or
659           region for which they are defined.
660
661       D.  UN numeric codes for countries or areas for which there is an
662           associated ISO 3166 alpha-2 code in the registry MUST NOT be
663           entered into the registry and MUST NOT be used to form
664           language tags.  Note that the ISO 3166-based subtag in the
665           registry MUST actually be associated with the UN M.49 code in
666           question.
667
668
669
670
671
672
673Phillips & Davis         Best Current Practice                 [Page 12]
674
675RFC 4646             Tags for Identifying Languages       September 2006
676
677
678       E.  UN numeric codes and ISO 3166 alpha-2 codes for countries or
679           areas listed as eligible for registration in [RFC4645] but
680           not presently registered MAY be entered into the IANA
681           registry via the process described in Section 3.5.  Once
682           registered, these codes MAY be used to form language tags.
683
684       F.  All other UN numeric codes for countries or areas that do not
685           have an associated ISO 3166 alpha-2 code MUST NOT be entered
686           into the registry and MUST NOT be used to form language tags.
687           For more information about these codes, see Section 3.4.
688
689   4.  Note: The alphanumeric codes in Appendix X of the UN document
690       MUST NOT be entered into the registry and MUST NOT be used to
691       form language tags.  (At the time this document was created,
692       these values matched the ISO 3166 alpha-2 codes.)
693
694   5.  There MUST be at most one region subtag in a language tag and the
695       region subtag MAY be omitted, as when it adds no distinguishing
696       value to the tag.
697
698   6.  The region subtags 'AA', 'QM'-'QZ', 'XA'-'XZ', and 'ZZ' are
699       reserved for private use in language tags.  These subtags
700       correspond to codes reserved by ISO 3166 for private use.  These
701       codes MAY be used for private use region subtags (instead of
702       using a private use subtag sequence).  Please refer to
703       Section 4.5 for more information on private use subtags.
704
705   "de-CH" represents German ('de') as used in Switzerland ('CH').
706
707   "sr-Latn-CS" represents Serbian ('sr') written using Latin script
708   ('Latn') as used in Serbia and Montenegro ('CS').
709
710   "es-419" represents Spanish ('es') appropriate to the UN-defined
711   Latin America and Caribbean region ('419').
712
7132.2.5.  Variant Subtags
714
715   Variant subtags are used to indicate additional, well-recognized
716   variations that define a language or its dialects that are not
717   covered by other available subtags.  The following rules apply to the
718   variant subtags:
719
720   1.  Variant subtags are not associated with any external standard.
721       Variant subtags and their meanings are defined by the
722       registration process defined in Section 3.5.
723
724   2.  Variant subtags MUST follow all of the other defined subtags, but
725       precede any extension or private use subtag sequences.
726
727
728
729Phillips & Davis         Best Current Practice                 [Page 13]
730
731RFC 4646             Tags for Identifying Languages       September 2006
732
733
734   3.  More than one variant MAY be used to form the language tag.
735
736   4.  Variant subtags MUST be registered with IANA according to the
737       rules in Section 3.5 of this document before being used to form
738       language tags.  In order to distinguish variants from other types
739       of subtags, registrations MUST meet the following length and
740       content restrictions:
741
742       1.  Variant subtags that begin with a letter (a-z, A-Z) MUST be
743           at least five characters long.
744
745       2.  Variant subtags that begin with a digit (0-9) MUST be at
746           least four characters long.
747
748   Variant subtag records in the language subtag registry MAY include
749   one or more 'Prefix' fields, which indicate the language tag or tags
750   that would make a suitable prefix (with other subtags, as
751   appropriate) in forming a language tag with the variant.  For
752   example, the subtag 'nedis' has a Prefix of "sl", making it suitable
753   to form language tags such as "sl-nedis" and "sl-IT-nedis", but not
754   suitable for use in a tag such as "zh-nedis" or "it-IT-nedis".
755
756   "sl-nedis" represents the Natisone or Nadiza dialect of Slovenian.
757
758   "de-CH-1996" represents German as used in Switzerland and as written
759   using the spelling reform beginning in the year 1996 C.E.
760
761   Most variants that share a prefix are mutually exclusive.  For
762   example, the German orthographic variations '1996' and '1901' SHOULD
763   NOT be used in the same tag, as they represent the dates of different
764   spelling reforms.  A variant that can meaningfully be used in
765   combination with another variant SHOULD include a 'Prefix' field in
766   its registry record that lists that other variant.  For example, if
767   another German variant 'example' were created that made sense to use
768   with '1996', then 'example' should include two Prefix fields: "de"
769   and "de-1996".
770
7712.2.6.  Extension Subtags
772
773   Extensions provide a mechanism for extending language tags for use in
774   various applications.  See Section 3.7.  The following rules apply to
775   extensions:
776
777   1.   Extension subtags are separated from the other subtags defined
778        in this document by a single-character subtag ("singleton").
779        The singleton MUST be one allocated to a registration authority
780        via the mechanism described in Section 3.7 and MUST NOT be the
781        letter 'x', which is reserved for private use subtag sequences.
782
783
784
785Phillips & Davis         Best Current Practice                 [Page 14]
786
787RFC 4646             Tags for Identifying Languages       September 2006
788
789
790   2.   Note: Private use subtag sequences starting with the singleton
791        subtag 'x' are described in Section 2.2.7 below.
792
793   3.   An extension MUST follow at least a primary language subtag.
794        That is, a language tag cannot begin with an extension.
795        Extensions extend language tags, they do not override or replace
796        them.  For example, "a-value" is not a well-formed language tag,
797        while "de-a-value" is.
798
799   4.   Each singleton subtag MUST appear at most one time in each tag
800        (other than as a private use subtag).  That is, singleton
801        subtags MUST NOT be repeated.  For example, the tag
802        "en-a-bbb-a-ccc" is invalid because the subtag 'a' appears
803        twice.  Note that the tag "en-a-bbb-x-a-ccc" is valid because
804        the second appearance of the singleton 'a' is in a private use
805        sequence.
806
807   5.   Extension subtags MUST meet all of the requirements for the
808        content and format of subtags defined in this document.
809
810   6.   Extension subtags MUST meet whatever requirements are set by the
811        document that defines their singleton prefix and whatever
812        requirements are provided by the maintaining authority.
813
814   7.   Each extension subtag MUST be from two to eight characters long
815        and consist solely of letters or digits, with each subtag
816        separated by a single '-'.
817
818   8.   Each singleton MUST be followed by at least one extension
819        subtag.  For example, the tag "tlh-a-b-foo" is invalid because
820        the first singleton 'a' is followed immediately by another
821        singleton 'b'.
822
823   9.   Extension subtags MUST follow all language, extended language,
824        script, region, and variant subtags in a tag.
825
826   10.  All subtags following the singleton and before another singleton
827        are part of the extension.  Example: In the tag "fr-a-Latn", the
828        subtag 'Latn' does not represent the script subtag 'Latn'
829        defined in the IANA Language Subtag Registry.  Its meaning is
830        defined by the extension 'a'.
831
832   11.  In the event that more than one extension appears in a single
833        tag, the tag SHOULD be canonicalized as described in
834        Section 4.4.
835
836
837
838
839
840
841Phillips & Davis         Best Current Practice                 [Page 15]
842
843RFC 4646             Tags for Identifying Languages       September 2006
844
845
846   For example, if the prefix singleton 'r' and the shown subtags were
847   defined, then the following tag would be a valid example:
848   "en-Latn-GB-boont-r-extended-sequence-x-private".
849
8502.2.7.  Private Use Subtags
851
852   Private use subtags are used to indicate distinctions in language
853   important in a given context by private agreement.  The following
854   rules apply to private use subtags:
855
856   1.  Private use subtags are separated from the other subtags defined
857       in this document by the reserved single-character subtag 'x'.
858
859   2.  Private use subtags MUST conform to the format and content
860       constraints defined in the ABNF for all subtags.
861
862   3.  Private use subtags MUST follow all language, extended language,
863       script, region, variant, and extension subtags in the tag.
864       Another way of saying this is that all subtags following the
865       singleton 'x' MUST be considered private use.  Example: The
866       subtag 'US' in the tag "en-x-US" is a private use subtag.
867
868   4.  A tag MAY consist entirely of private use subtags.
869
870   5.  No source is defined for private use subtags.  Use of private use
871       subtags is by private agreement only.
872
873   6.  Private use subtags are NOT RECOMMENDED where alternatives exist
874       or for general interchange.  See Section 4.5 for more information
875       on private use subtag choice.
876
877   For example: Users who wished to utilize codes from the Ethnologue
878   publication of SIL International for language identification might
879   agree to exchange tags such as "az-Arab-x-AZE-derbend".  This example
880   contains two private use subtags.  The first is 'AZE' and the second
881   is 'derbend'.
882
8832.2.8.  Preexisting RFC 3066 Registrations
884
885   Existing IANA-registered language tags from RFC 1766 and/or RFC 3066
886   maintain their validity.  These tags will be maintained in the
887   registry in records of either the "grandfathered" or "redundant"
888   type.  Grandfathered tags contain one or more subtags that are not
889   defined in the Language Subtag Registry (see Section 3).  Redundant
890   tags consist entirely of subtags defined above and whose independent
891   registration is superseded by this document.  For more information,
892   see Section 3.8.
893
894
895
896
897Phillips & Davis         Best Current Practice                 [Page 16]
898
899RFC 4646             Tags for Identifying Languages       September 2006
900
901
902   It is important to note that all language tags formed under the
903   guidelines in this document were either legal, well-formed tags or
904   could have been registered under RFC 3066.
905
9062.2.9.  Classes of Conformance
907
908   Implementations sometimes need to describe their capabilities with
909   regard to the rules and practices described in this document.  There
910   are two classes of conforming implementations described by this
911   document: "well-formed" processors and "validating" processors.
912   Claims of conformance SHOULD explicitly reference one of these
913   definitions.
914
915   An implementation that claims to check for well-formed language tags
916   MUST:
917
918   o  Check that the tag and all of its subtags, including extension and
919      private use subtags, conform to the ABNF or that the tag is on the
920      list of grandfathered tags.
921
922   o  Check that singleton subtags that identify extensions do not
923      repeat.  For example, the tag "en-a-xx-b-yy-a-zz" is not well-
924      formed.
925
926   Well-formed processors are strongly encouraged to implement the
927   canonicalization rules contained in Section 4.4.
928
929   An implementation that claims to be validating MUST:
930
931   o  Check that the tag is well-formed.
932
933   o  Specify the particular registry date for which the implementation
934      performs validation of subtags.
935
936   o  Check that either the tag is a grandfathered tag, or that all
937      language, script, region, and variant subtags consist of valid
938      codes for use in language tags according to the IANA registry as
939      of the particular date specified by the implementation.
940
941   o  Specify which, if any, extension RFCs as defined in Section 3.7
942      are supported, including version, revision, and date.
943
944   o  For any such extensions supported, check that all subtags used in
945      that extension are valid.
946
947   o  For variant and extended language subtags, if the registry
948      contains one or more 'Prefix' fields for that subtag, check that
949      the tag matches at least one prefix.  The tag matches if all the
950
951
952
953Phillips & Davis         Best Current Practice                 [Page 17]
954
955RFC 4646             Tags for Identifying Languages       September 2006
956
957
958      subtags in the 'Prefix' also appear in the tag.  For example, the
959      prefix "es-CO" matches the tag "es-Latn-CO-x-private" because both
960      the 'es' language subtag and 'CO' region subtag appear in the tag.
961
9623.  Registry Format and Maintenance
963
964   This section defines the Language Subtag Registry and the maintenance
965   and update procedures associated with it, as well as a registry for
966   extensions to language tags (Section 3.7).
967
968   The Language Subtag Registry contains a comprehensive list of all of
969   the subtags valid in language tags.  This allows implementers a
970   straightforward and reliable way to validate language tags.  The
971   Language Subtag Registry will be maintained so that, except for
972   extension subtags, it is possible to validate all of the subtags that
973   appear in a language tag under the provisions of this document or its
974   revisions or successors.  In addition, the meaning of the various
975   subtags will be unambiguous and stable over time.  (The meaning of
976   private use subtags, of course, is not defined by the IANA registry.)
977
9783.1.  Format of the IANA Language Subtag Registry
979
980   The IANA Language Subtag Registry ("the registry") consists of a text
981   file that is machine readable in the format described in this
982   section, plus copies of the registration forms approved in accordance
983   with the process described in Section 3.5.  The existing registration
984   forms for grandfathered and redundant tags taken from RFC 3066 will
985   be maintained as part of the obsolete RFC 3066 registry.  The
986   remaining set of initial subtags will not have registration forms
987   created for them.
988
989   The registry is in the text format described below.  This format was
990   based on the record-jar format described in [record-jar].
991
992   Each line of text is limited to 72 characters, including all
993   whitespace.  Records are separated by lines containing only the
994   sequence "%%" (%x25.25).
995
996   Each field can be viewed as a single, logical line of ASCII
997   characters, comprising a field-name and a field-body separated by a
998   COLON character (%x3A).  For convenience, the field-body portion of
999   this conceptual entity can be split into a multiple-line
1000   representation; this is called "folding".  The format of the registry
1001   is described by the following ABNF (per [RFC4234]):
1002
1003
1004
1005
1006
1007
1008
1009Phillips & Davis         Best Current Practice                 [Page 18]
1010
1011RFC 4646             Tags for Identifying Languages       September 2006
1012
1013
1014   registry   = record *("%%" CRLF record)
1015   record     = 1*( field-name *SP ":" *SP field-body CRLF )
1016   field-name = (ALPHA / DIGIT) [*(ALPHA / DIGIT / "-") (ALPHA / DIGIT)]
1017   field-body = *(ASCCHAR/LWSP)
1018   ASCCHAR    = %x21-25 / %x27-7E / UNICHAR ; Note: AMPERSAND is %x26
1019   UNICHAR    = "&#x" 2*6HEXDIG ";"
1020
1021                      Figure 2: Registry Format ABNF
1022
1023   The sequence '..' (%x2E.2E) in a field-body denotes a range of
1024   values.  Such a range represents all subtags of the same length that
1025   are in alphabetic or numeric order within that range, including the
1026   values explicitly mentioned.  For example 'a..c' denotes the values
1027   'a', 'b', and 'c' and '11..13' denotes the values '11', '12', and
1028   '13'.
1029
1030   Characters from outside the US-ASCII [ISO646] repertoire, as well as
1031   the AMPERSAND character ("&", %x26) when it occurs in a field-body,
1032   are represented by a "Numeric Character Reference" using hexadecimal
1033   notation in the style used by [XML10] (see
1034   <http://www.w3.org/TR/REC-xml/#dt-charref>).  This consists of the
1035   sequence "&#x" (%x26.23.78) followed by a hexadecimal representation
1036   of the character's code point in [ISO10646] followed by a closing
1037   semicolon (%x3B).  For example, the EURO SIGN, U+20AC, would be
1038   represented by the sequence "&#x20AC;".  Note that the hexadecimal
1039   notation MAY have between two and six digits.
1040
1041   All fields whose field-body contains a date value use the "full-date"
1042   format specified in [RFC3339].  For example: "2004-06-28" represents
1043   June 28, 2004, in the Gregorian calendar.
1044
1045   The first record in the file contains the single field whose field-
1046   name is "File-Date" (see Figure 3).  The field-body of this record
1047   contains the last modification date of this copy of the registry,
1048   making it possible to compare different versions of the registry.
1049   The registry on the IANA website is the most current.  Versions with
1050   an older date than that one are not up-to-date.
1051
1052   File-Date: 2004-06-28
1053   %%
1054
1055                 Figure 3: Example of the File-Date Record
1056
1057   Subsequent records represent subtags in the registry.  Each of the
1058   fields in each record MUST occur no more than once, unless otherwise
1059   noted below.  Each record MUST contain the following fields:
1060
1061
1062
1063
1064
1065Phillips & Davis         Best Current Practice                 [Page 19]
1066
1067RFC 4646             Tags for Identifying Languages       September 2006
1068
1069
1070   o  'Type'
1071
1072      *  Type's field-value MUST consist of one of the following
1073         strings: "language", "extlang", "script", "region", "variant",
1074         "grandfathered", and "redundant" and denotes the type of tag or
1075         subtag.
1076
1077   o  Either 'Subtag' or 'Tag'
1078
1079      *  Subtag's field-value contains the subtag being defined.  This
1080         field MUST only appear in records of whose 'Type' has one of
1081         these values: "language", "extlang", "script", "region", or
1082         "variant".
1083
1084      *  Tag's field-value contains a complete language tag.  This field
1085         MUST only appear in records whose 'Type' has one of these
1086         values: "grandfathered" or "redundant".  Note that the field-
1087         value will always follow the 'grandfathered' production in the
1088         ABNF in Section 2.1
1089
1090   o  Description
1091
1092      *  Description's field-value contains a non-normative description
1093         of the subtag or tag.
1094
1095   o  Added
1096
1097      *  Added's field-value contains the date the record was added to
1098         the registry.
1099
1100   The 'Subtag' or 'Tag' field MUST use lowercase letters to form the
1101   subtag or tag, with two exceptions.  Subtags whose 'Type' field is
1102   'script' (in other words, subtags defined by ISO 15924) MUST use
1103   titlecase.  Subtags whose 'Type' field is 'region' (in other words,
1104   subtags defined by ISO 3166) MUST use uppercase.  These exceptions
1105   mirror the use of case in the underlying standards.
1106
1107   The field 'Description' MAY appear more than one time and contains a
1108   description of the tag or subtag in the record.  At least one of the
1109   'Description' fields MUST be written or transcribed into the Latin
1110   script; the same or additional fields MAY also include a description
1111   in a non-Latin script.  The 'Description' field is used for
1112   identification purposes and SHOULD NOT be taken to represent the
1113   actual native name of the language or variation or to be in any
1114   particular language.  Most descriptions are taken directly from
1115   source standards such as ISO 639 or ISO 3166.
1116
1117
1118
1119
1120
1121Phillips & Davis         Best Current Practice                 [Page 20]
1122
1123RFC 4646             Tags for Identifying Languages       September 2006
1124
1125
1126   Note: Descriptions in registry entries that correspond to ISO 639,
1127   ISO 15924, ISO 3166, or UN M.49 codes are intended only to indicate
1128   the meaning of that identifier as defined in the source standard at
1129   the time it was added to the registry.  The description does not
1130   replace the content of the source standard itself.  The descriptions
1131   are not intended to be the English localized names for the subtags.
1132   Localization or translation of language tag and subtag descriptions
1133   is out of scope of this document.
1134
1135   Each record MAY also contain the following fields:
1136
1137   o  Preferred-Value
1138
1139      *  For fields of type 'language', 'extlang', 'script', 'region',
1140         and 'variant', 'Preferred-Value' contains the subtag of the
1141         same 'Type' that is preferred for forming the language tag.
1142
1143      *  For fields of type 'grandfathered' and 'redundant', a canonical
1144         mapping to a complete language tag.
1145
1146   o  Deprecated
1147
1148      *  Deprecated's field-value contains the date the record was
1149         deprecated.
1150
1151   o  Prefix
1152
1153      *  Prefix's field-value contains a language tag with which this
1154         subtag MAY be used to form a new language tag, perhaps with
1155         other subtags as well.  This field MUST only appear in records
1156         whose 'Type' field-value is 'variant' or 'extlang'.  For
1157         example, the 'Prefix' for the variant 'nedis' is 'sl', meaning
1158         that the tags "sl-nedis" and "sl-IT-nedis" might be appropriate
1159         while the tag "is-nedis" is not.
1160
1161   o  Comments
1162
1163      *  Comments contains additional information about the subtag, as
1164         deemed appropriate for understanding the registry and
1165         implementing language tags using the subtag or tag.
1166
1167   o  Suppress-Script
1168
1169      *  Suppress-Script contains a script subtag that SHOULD NOT be
1170         used to form language tags with the associated primary language
1171         subtag.  This field MUST only appear in records whose 'Type'
1172         field-value is 'language'.  See Section 4.1.
1173
1174
1175
1176
1177Phillips & Davis         Best Current Practice                 [Page 21]
1178
1179RFC 4646             Tags for Identifying Languages       September 2006
1180
1181
1182   The field 'Deprecated' MAY be added to any record via the maintenance
1183   process described in Section 3.3 or via the registration process
1184   described in Section 3.5.  Usually, the addition of a 'Deprecated'
1185   field is due to the action of one of the standards bodies, such as
1186   ISO 3166, withdrawing a code.  In some historical cases, it might not
1187   have been possible to reconstruct the original deprecation date.  For
1188   these cases, an approximate date appears in the registry.  Although
1189   valid in language tags, subtags and tags with a 'Deprecated' field
1190   are deprecated and validating processors SHOULD NOT generate these
1191   subtags.  Note that a record that contains a 'Deprecated' field and
1192   no corresponding 'Preferred-Value' field has no replacement mapping.
1193
1194   The field 'Preferred-Value' contains a mapping between the record in
1195   which it appears and another tag or subtag.  The value in this field
1196   is STRONGLY RECOMMENDED as the best choice to represent the value of
1197   this record when selecting a language tag.  These values form three
1198   groups:
1199
1200   1.  ISO 639 language codes that were later withdrawn in favor of
1201       other codes.  These values are mostly a historical curiosity.
1202
1203   2.  ISO 3166 region codes that have been withdrawn in favor of a new
1204       code.  This sometimes happens when a country changes its name or
1205       administration in such a way that warrants a new region code.
1206
1207   3.  Tags grandfathered from RFC 3066.  In many cases, these tags have
1208       become obsolete because the values they represent were later
1209       encoded by ISO 639.
1210
1211   Records that contain a 'Preferred-Value' field MUST also have a
1212   'Deprecated' field.  This field contains a date of deprecation.
1213   Thus, a language tag processor can use the registry to construct the
1214   valid, non-deprecated set of subtags for a given date.  In addition,
1215   for any given tag, a processor can construct the set of valid
1216   language tags that correspond to that tag for all dates up to the
1217   date of the registry.  The ability to do these mappings MAY be
1218   beneficial to applications that are matching, selecting, for
1219   filtering content based on its language tags.
1220
1221   Note that 'Preferred-Value' mappings in records of type 'region'
1222   sometimes do not represent exactly the same meaning as the original
1223   value.  There are many reasons for a country code to be changed, and
1224   the effect this has on the formation of language tags will depend on
1225   the nature of the change in question.
1226
1227   In particular, the 'Preferred-Value' field does not imply retagging
1228   content that uses the affected subtag.
1229
1230
1231
1232
1233Phillips & Davis         Best Current Practice                 [Page 22]
1234
1235RFC 4646             Tags for Identifying Languages       September 2006
1236
1237
1238   The field 'Preferred-Value' MUST NOT be modified once created in the
1239   registry.  The field MAY be added to records of type "grandfathered"
1240   and "region" according to the rules in Section 3.3.  Otherwise the
1241   field MUST NOT be added to any record already in the registry.
1242
1243   The 'Preferred-Value' field in records of type "grandfathered" and
1244   "redundant" contains whole language tags that are strongly
1245   RECOMMENDED for use in place of the record's value.  In many cases,
1246   the mappings were created by deprecation of the tags during the
1247   period before this document was adopted.  For example, the tag
1248   "no-nyn" was deprecated in favor of the ISO 639-1-defined language
1249   code 'nn'.
1250
1251   Records of type 'variant' MAY have more than one field of type
1252   'Prefix'.  Additional fields of this type MAY be added to a 'variant'
1253   record via the registration process.
1254
1255   Records of type 'extlang' MUST have _exactly_ one 'Prefix' field.
1256
1257   The field-value of the 'Prefix' field consists of a language tag
1258   whose subtags are appropriate to use with this subtag.  For example,
1259   the variant subtag '1996' has a 'Prefix' field of "de".  This means
1260   that tags starting with the sequence "de-" are appropriate with this
1261   subtag, so "de-Latg-1996" and "de-CH-1996" are both acceptable, while
1262   the tag "fr-1996" is an inappropriate choice.
1263
1264   The field of type 'Prefix' MUST NOT be removed from any record.  The
1265   field-value for this type of field MUST NOT be modified.
1266
1267   The field 'Comments' MAY appear more than once per record.  This
1268   field MAY be inserted or changed via the registration process and no
1269   guarantee of stability is provided.  The content of this field is not
1270   restricted, except by the need to register the information, the
1271   suitability of the request, and by reasonable practical size
1272   limitations.
1273
1274   The field 'Suppress-Script' MUST only appear in records whose 'Type'
1275   field-value is 'language'.  This field MUST NOT appear more than one
1276   time in a record.  This field indicates a script used to write the
1277   overwhelming majority of documents for the given language and that
1278   therefore adds no distinguishing information to a language tag.  It
1279   helps ensure greater compatibility between the language tags
1280   generated according to the rules in this document and language tags
1281   and tag processors or consumers based on RFC 3066.  For example,
1282   virtually all Icelandic documents are written in the Latin script,
1283   making the subtag 'Latn' redundant in the tag "is-Latn".
1284
1285
1286
1287
1288
1289Phillips & Davis         Best Current Practice                 [Page 23]
1290
1291RFC 4646             Tags for Identifying Languages       September 2006
1292
1293
12943.2.  Language Subtag Reviewer
1295
1296   The Language Subtag Reviewer is appointed by the IESG for an
1297   indefinite term, subject to removal or replacement at the IESG's
1298   discretion.  The Language Subtag Reviewer moderates the ietf-
1299   languages mailing list, responds to requests for registration, and
1300   performs the other registry maintenance duties described in
1301   Section 3.3.  Only the Language Subtag Reviewer is permitted to
1302   request IANA to change, update, or add records to the Language Subtag
1303   Registry.
1304
1305   The performance or decisions of the Language Subtag Reviewer MAY be
1306   appealed to the IESG under the same rules as other IETF decisions
1307   (see [RFC2026]).  The IESG can reverse or overturn the decision of
1308   the Language Subtag Reviewer, provide guidance, or take other
1309   appropriate actions.
1310
13113.3.  Maintenance of the Registry
1312
1313   Maintenance of the registry requires that as codes are assigned or
1314   withdrawn by ISO 639, ISO 15924, ISO 3166, and UN M.49, the Language
1315   Subtag Reviewer MUST evaluate each change, determine whether it
1316   conflicts with existing registry entries, and submit the information
1317   to IANA for inclusion in the registry.  If a change takes place and
1318   the Language Subtag Reviewer does not do this in a timely manner,
1319   then any interested party MAY use the procedure in Section 3.5 to
1320   register the appropriate update.
1321
1322   Note: The redundant and grandfathered entries together are the
1323   complete list of tags registered under [RFC3066].  The redundant tags
1324   are those that can now be formed using the subtags defined in the
1325   registry together with the rules of Section 2.2.  The grandfathered
1326   entries include those that can never be legal under those same
1327   provisions.
1328
1329   The set of redundant and grandfathered tags is permanent and stable:
1330   new entries in this section MUST NOT be added and existing entries
1331   MUST NOT be removed.  Records of type 'grandfathered' MAY have their
1332   type converted to 'redundant'; see item 12 in Section 3.6 for more
1333   information.  The decision-making process about which tags were
1334   initially grandfathered and which were made redundant is described in
1335   [RFC4645].
1336
1337   RFC 3066 tags that were deprecated prior to the adoption of this
1338   document are part of the list of grandfathered tags, and their
1339   component subtags were not included as registered variants (although
1340   they remain eligible for registration).  For example, the tag
1341   "art-lojban" was deprecated in favor of the language subtag 'jbo'.
1342
1343
1344
1345Phillips & Davis         Best Current Practice                 [Page 24]
1346
1347RFC 4646             Tags for Identifying Languages       September 2006
1348
1349
1350   The Language Subtag Reviewer MUST ensure that new subtags meet the
1351   requirements in Section 4.1 or submit an appropriate alternate subtag
1352   as described in that section.  When either a change or addition to
1353   the registry is needed, the Language Subtag Reviewer MUST prepare the
1354   complete record, including all fields, and forward it to IANA for
1355   insertion into the registry.  Each record being modified or inserted
1356   MUST be forwarded in a separate message.
1357
1358   If a record represents a new subtag that does not currently exist in
1359   the registry, then the message's subject line MUST include the word
1360   "INSERT".  If the record represents a change to an existing subtag,
1361   then the subject line of the message MUST include the word "MODIFY".
1362   The message MUST contain both the record for the subtag being
1363   inserted or modified and the new File-Date record.  Here is an
1364   example of what the body of the message might contain:
1365
1366   LANGUAGE SUBTAG MODIFICATION
1367   File-Date: 2005-01-02
1368   %%
1369   Type: variant
1370   Subtag: nedis
1371   Description: Natisone dialect
1372   Description: Nadiza dialect
1373   Added: 2003-10-09
1374   Prefix: sl
1375   Comments: This is a comment shown
1376     as an example.
1377   %%
1378
1379         Figure 4: Example of a Language Subtag Modification Form
1380
1381   Whenever an entry is created or modified in the registry, the
1382   'File-Date' record at the start of the registry is updated to reflect
1383   the most recent modification date in the [RFC3339] "full-date"
1384   format.
1385
1386   Before forwarding a new registration to IANA, the Language Subtag
1387   Reviewer MUST ensure that values in the 'Subtag' field match case
1388   according to the description in Section 3.1.
1389
13903.4.  Stability of IANA Registry Entries
1391
1392   The stability of entries and their meaning in the registry is
1393   critical to the long-term stability of language tags.  The rules in
1394   this section guarantee that a specific language tag's meaning is
1395   stable over time and will not change.
1396
1397
1398
1399
1400
1401Phillips & Davis         Best Current Practice                 [Page 25]
1402
1403RFC 4646             Tags for Identifying Languages       September 2006
1404
1405
1406   These rules specifically deal with how changes to codes (including
1407   withdrawal and deprecation of codes) maintained by ISO 639, ISO
1408   15924, ISO 3166, and UN M.49 are reflected in the IANA Language
1409   Subtag Registry.  Assignments to the IANA Language Subtag Registry
1410   MUST follow the following stability rules:
1411
1412   1.   Values in the fields 'Type', 'Subtag', 'Tag', 'Added',
1413        'Deprecated' and 'Preferred-Value' MUST NOT be changed and are
1414        guaranteed to be stable over time.
1415
1416   2.   Values in the 'Description' field MUST NOT be changed in a way
1417        that would invalidate previously-existing tags.  They MAY be
1418        broadened somewhat in scope, changed to add information, or
1419        adapted to the most common modern usage.  For example, countries
1420        occasionally change their official names; a historical example
1421        of this would be "Upper Volta" changing to "Burkina Faso".
1422
1423   3.   Values in the field 'Prefix' MAY be added to records of type
1424        'variant' via the registration process.
1425
1426   4.   Values in the field 'Prefix' MAY be modified, so long as the
1427        modifications broaden the set of prefixes.  That is, a prefix
1428        MAY be replaced by one of its own prefixes.  For example, the
1429        prefix "en-US" could be replaced by "en", but not by the
1430        prefixes "en-Latn", "fr", or "en-US-boont".  If one of those
1431        prefixes were needed, a new Prefix SHOULD be registered.
1432
1433   5.   Values in the field 'Prefix' MUST NOT be removed.
1434
1435   6.   The field 'Comments' MAY be added, changed, modified, or removed
1436        via the registration process or any of the processes or
1437        considerations described in this section.
1438
1439   7.   The field 'Suppress-Script' MAY be added or removed via the
1440        registration process.
1441
1442   8.   Codes assigned by ISO 639, ISO 15924, and ISO 3166 that do not
1443        conflict with existing subtags of the associated type and whose
1444        meaning is not the same as an existing subtag of the same type
1445        are entered into the IANA registry as new records.
1446
1447   9.   Codes assigned by ISO 639, ISO 15924, or ISO 3166 that are
1448        withdrawn by their respective maintenance or registration
1449        authority remain valid in language tags.  A 'Deprecated' field
1450        containing the date of withdrawal is added to the record.  If a
1451        new record of the same type is added that represents a
1452
1453
1454
1455
1456
1457Phillips & Davis         Best Current Practice                 [Page 26]
1458
1459RFC 4646             Tags for Identifying Languages       September 2006
1460
1461
1462        replacement value, then a 'Preferred-Value' field MAY also be
1463        added.  The registration process MAY be used to add comments
1464        about the withdrawal of the code by the respective standard.
1465
1466        Example
1467           The region code 'TL' was assigned to the country 'Timor-
1468           Leste', replacing the code 'TP' (which was assigned to 'East
1469           Timor' when it was under administration by Portugal).  The
1470           subtag 'TP' remains valid in language tags, but its record
1471           contains the a 'Preferred-Value' of 'TL' and its field
1472           'Deprecated' contains the date the new code was assigned
1473           ('2004-07-06').
1474
1475   10.  Codes assigned by ISO 639, ISO 15924, or ISO 3166 that conflict
1476        with existing subtags of the associated type, including subtags
1477        that are deprecated, MUST NOT be entered into the registry.  The
1478        following additional considerations apply to subtag values that
1479        are reassigned:
1480
1481        A.  For ISO 639 codes, if the newly assigned code's meaning is
1482            not represented by a subtag in the IANA registry, the
1483            Language Subtag Reviewer, as described in Section 3.5, SHALL
1484            prepare a proposal for entering in the IANA registry as soon
1485            as practical a registered language subtag as an alternate
1486            value for the new code.  The form of the registered language
1487            subtag will be at the discretion of the Language Subtag
1488            Reviewer and MUST conform to other restrictions on language
1489            subtags in this document.
1490
1491        B.  For all subtags whose meaning is derived from an external
1492            standard (i.e., ISO 639, ISO 15924, ISO 3166, or UN M.49),
1493            if a new meaning is assigned to an existing code and the new
1494            meaning broadens the meaning of that code, then the meaning
1495            for the associated subtag MAY be changed to match.  The
1496            meaning of a subtag MUST NOT be narrowed, however, as this
1497            can result in an unknown proportion of the existing uses of
1498            a subtag becoming invalid.  Note: ISO 639 maintenance
1499            agency/registration authority (MA/RA) has adopted a similar
1500            stability policy.
1501
1502        C.  For ISO 15924 codes, if the newly assigned code's meaning is
1503            not represented by a subtag in the IANA registry, the
1504            Language Subtag Reviewer, as described in Section 3.5, SHALL
1505            prepare a proposal for entering in the IANA registry as soon
1506            as practical a registered variant subtag as an alternate
1507            value for the new code.  The form of the registered variant
1508
1509
1510
1511
1512
1513Phillips & Davis         Best Current Practice                 [Page 27]
1514
1515RFC 4646             Tags for Identifying Languages       September 2006
1516
1517
1518            subtag will be at the discretion of the Language Subtag
1519            Reviewer and MUST conform to other restrictions on variant
1520            subtags in this document.
1521
1522        D.  For ISO 3166 codes, if the newly assigned code's meaning is
1523            associated with the same UN M.49 code as another 'region'
1524            subtag, then the existing region subtag remains as the
1525            preferred value for that region and no new entry is created.
1526            A comment MAY be added to the existing region subtag
1527            indicating the relationship to the new ISO 3166 code.
1528
1529        E.  For ISO 3166 codes, if the newly assigned code's meaning is
1530            associated with a UN M.49 code that is not represented by an
1531            existing region subtag, then the Language Subtag Reviewer,
1532            as described in Section 3.5, SHALL prepare a proposal for
1533            entering the appropriate UN M.49 country code as an entry in
1534            the IANA registry.
1535
1536        F.  For ISO 3166 codes, if there is no associated UN numeric
1537            code, then the Language Subtag Reviewer SHALL petition the
1538            UN to create one.  If there is no response from the UN
1539            within ninety days of the request being sent, the Language
1540            Subtag Reviewer SHALL prepare a proposal for entering in the
1541            IANA registry as soon as practical a registered variant
1542            subtag as an alternate value for the new code.  The form of
1543            the registered variant subtag will be at the discretion of
1544            the Language Subtag Reviewer and MUST conform to other
1545            restrictions on variant subtags in this document.  This
1546            situation is very unlikely to ever occur.
1547
1548   11.  UN M.49 has codes for both countries and areas (such as '276'
1549        for Germany) and geographical regions and sub-regions (such as
1550        '150' for Europe).  UN M.49 country or area codes for which
1551        there is no corresponding ISO 3166 code SHOULD NOT be
1552        registered, except as a surrogate for an ISO 3166 code that is
1553        blocked from registration by an existing subtag.  If such a code
1554        becomes necessary, then the registration authority for ISO 3166
1555        SHOULD first be petitioned to assign a code to the region.  If
1556        the petition for a code assignment by ISO 3166 is refused or not
1557        acted on in a timely manner, the registration process described
1558        in Section 3.5 MAY then be used to register the corresponding UN
1559        M.49 code.  At the time this document was written, there were
1560        only four such codes: 830 (Channel Islands), 831 (Guernsey), 832
1561        (Jersey), and 833 (Isle of Man).  This way, UN M.49 codes remain
1562        available as the value of last resort in cases where ISO 3166
1563        reassigns a deprecated value in the registry.
1564
1565
1566
1567
1568
1569Phillips & Davis         Best Current Practice                 [Page 28]
1570
1571RFC 4646             Tags for Identifying Languages       September 2006
1572
1573
1574   12.  Stability provisions apply to grandfathered tags with this
1575        exception: should all of the subtags in a grandfathered tag
1576        become valid subtags in the IANA registry, then the field 'Type'
1577        in that record is changed from 'grandfathered' to 'redundant'.
1578        Note that this will not affect language tags that match the
1579        grandfathered tag, since these tags will now match valid
1580        generative subtag sequences.  For example, if the subtag 'gan'
1581        in the language tag "zh-gan" were to be registered as an
1582        extended language subtag, then the grandfathered tag "zh-gan"
1583        would be deprecated (but existing content or implementations
1584        that use "zh-gan" would remain valid).
1585
15863.5.  Registration Procedure for Subtags
1587
1588   The procedure given here MUST be used by anyone who wants to use a
1589   subtag not currently in the IANA Language Subtag Registry.
1590
1591   Only subtags of type 'language' and 'variant' will be considered for
1592   independent registration of new subtags.  Handling of subtags needed
1593   for stability and subtags necessary to keep the registry synchronized
1594   with ISO 639, ISO 15924, ISO 3166, and UN M.49 within the limits
1595   defined by this document are described in Section 3.3.  Stability
1596   provisions are described in Section 3.4.
1597
1598   This procedure MAY also be used to register or alter the information
1599   for the 'Description', 'Comments', 'Deprecated', or 'Prefix' fields
1600   in a subtag's record as described in Section 3.4.  Changes to all
1601   other fields in the IANA registry are NOT permitted.
1602
1603   Registering a new subtag or requesting modifications to an existing
1604   tag or subtag starts with the requester filling out the registration
1605   form reproduced below.  Note that each response is not limited in
1606   size so that the request can adequately describe the registration.
1607   The fields in the "Record Requested" section SHOULD follow the
1608   requirements in Section 3.1.
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625Phillips & Davis         Best Current Practice                 [Page 29]
1626
1627RFC 4646             Tags for Identifying Languages       September 2006
1628
1629
1630   LANGUAGE SUBTAG REGISTRATION FORM
1631   1. Name of requester:
1632   2. E-mail address of requester:
1633   3. Record Requested:
1634
1635      Type:
1636      Subtag:
1637      Description:
1638      Prefix:
1639      Preferred-Value:
1640      Deprecated:
1641      Suppress-Script:
1642      Comments:
1643
1644   4. Intended meaning of the subtag:
1645   5. Reference to published description
1646      of the language (book or article):
1647   6. Any other relevant information:
1648
1649              Figure 5: The Language Subtag Registration Form
1650
1651   The subtag registration form MUST be sent to
1652   <ietf-languages@iana.org> for a two-week review period before it can
1653   be submitted to IANA.  (This is an open list and can be joined by
1654   sending a request to <ietf-languages-request@iana.org>.)
1655
1656   Variant subtags are usually registered for use with a particular
1657   range of language tags.  For example, the subtag 'rozaj' is intended
1658   for use with language tags that start with the primary language
1659   subtag "sl", since Resian is a dialect of Slovenian.  Thus, the
1660   subtag 'rozaj' would be appropriate in tags such as "sl-Latn-rozaj"
1661   or "sl-IT-rozaj".  This information is stored in the 'Prefix' field
1662   in the registry.  Variant registration requests SHOULD include at
1663   least one 'Prefix' field in the registration form.
1664
1665   Extended language subtags are reserved for future standardization.
1666   These subtags will be REQUIRED to include exactly one 'Prefix' field
1667   once they are allowed for registration.
1668
1669   The 'Prefix' field for a given registered subtag exists in the IANA
1670   registry as a guide to usage.  Additional prefixes MAY be added by
1671   filing an additional registration form.  In that form, the "Any other
1672   relevant information:" field MUST indicate that it is the addition of
1673   a prefix.
1674
1675   Requests to add a prefix to a variant subtag that imply a different
1676   semantic meaning will probably be rejected.  For example, a request
1677   to add the prefix "de" to the subtag 'nedis' so that the tag
1678
1679
1680
1681Phillips & Davis         Best Current Practice                 [Page 30]
1682
1683RFC 4646             Tags for Identifying Languages       September 2006
1684
1685
1686   "de-nedis" represented some German dialect would be rejected.  The
1687   'nedis' subtag represents a particular Slovenian dialect and the
1688   additional registration would change the semantic meaning assigned to
1689   the subtag.  A separate subtag SHOULD be proposed instead.
1690
1691   The 'Description' field MUST contain a description of the tag being
1692   registered written or transcribed into the Latin script; it MAY also
1693   include a description in a non-Latin script.  Non-ASCII characters
1694   MUST be escaped using the syntax described in Section 3.1.  The
1695   'Description' field is used for identification purposes and doesn't
1696   necessarily represent the actual native name of the language or
1697   variation or to be in any particular language.
1698
1699   While the 'Description' field itself is not guaranteed to be stable
1700   and errata corrections MAY be undertaken from time to time, attempts
1701   to provide translations or transcriptions of entries in the registry
1702   itself will probably be frowned upon by the community or rejected
1703   outright, as changes of this nature have an impact on the provisions
1704   in Section 3.4.
1705
1706   When the two-week period has passed, the Language Subtag Reviewer
1707   either forwards the record to be inserted or modified to
1708   iana@iana.org according to the procedure described in Section 3.3, or
1709   rejects the request because of significant objections raised on the
1710   list or due to problems with constraints in this document (which MUST
1711   be explicitly cited).  The Language Subtag Reviewer MAY also extend
1712   the review period in two-week increments to permit further
1713   discussion.  The Language Subtag Reviewer MUST indicate on the list
1714   whether the registration has been accepted, rejected, or extended
1715   following each two-week period.
1716
1717   Note that the Language Subtag Reviewer MAY raise objections on the
1718   list if he or she so desires.  The important thing is that the
1719   objection MUST be made publicly.
1720
1721   The applicant is free to modify a rejected application with
1722   additional information and submit it again; this restarts the two-
1723   week comment period.
1724
1725   Decisions made by the Language Subtag Reviewer MAY be appealed to the
1726   IESG [RFC2028] under the same rules as other IETF decisions
1727   [RFC2026].
1728
1729   All approved registration forms are available online in the directory
1730   http://www.iana.org/numbers.html under "languages".
1731
1732
1733
1734
1735
1736
1737Phillips & Davis         Best Current Practice                 [Page 31]
1738
1739RFC 4646             Tags for Identifying Languages       September 2006
1740
1741
1742   Updates or changes to existing records follow the same procedure as
1743   new registrations.  The Language Subtag Reviewer decides whether
1744   there is consensus to update the registration following the two-week
1745   review period; normally, objections by the original registrant will
1746   carry extra weight in forming such a consensus.
1747
1748   Registrations are permanent and stable.  Once registered, subtags
1749   will not be removed from the registry and will remain a valid way in
1750   which to specify a specific language or variant.
1751
1752   Note: The purpose of the "Description" in the registration form is to
1753   aid people trying to verify whether a language is registered or what
1754   language or language variation a particular subtag refers to.  In
1755   most cases, reference to an authoritative grammar or dictionary of
1756   that language will be useful; in cases where no such work exists,
1757   other well-known works describing that language or in that language
1758   MAY be appropriate.  The Language Subtag Reviewer decides what
1759   constitutes "good enough" reference material.  This requirement is
1760   not intended to exclude particular languages or dialects due to the
1761   size of the speaker population or lack of a standardized orthography.
1762   Minority languages will be considered equally on their own merits.
1763
17643.6.  Possibilities for Registration
1765
1766   Possibilities for registration of subtags or information about
1767   subtags include:
1768
1769   o  Primary language subtags for languages not listed in ISO 639 that
1770      are not variants of any listed or registered language MAY be
1771      registered.  At the time this document was created, there were no
1772      examples of this form of subtag.  Before attempting to register a
1773      language subtag, there MUST be an attempt to register the language
1774      with ISO 639.  Subtags MUST NOT be registered for codes that exist
1775      in ISO 639-1 or ISO 639-2, that are under consideration by the ISO
1776      639 maintenance or registration authorities, or that have never
1777      been attempted for registration with those authorities.  If ISO
1778      639 has previously rejected a language for registration, it is
1779      reasonable to assume that there must be additional, very
1780      compelling evidence of need before it will be registered in the
1781      IANA registry (to the extent that it is very unlikely that any
1782      subtags will be registered of this type).
1783
1784   o  Dialect or other divisions or variations within a language, its
1785      orthography, writing system, regional or historical usage,
1786      transliteration or other transformation, or distinguishing
1787      variation MAY be registered as variant subtags.  An example is the
1788      'rozaj' subtag (the Resian dialect of Slovenian).
1789
1790
1791
1792
1793Phillips & Davis         Best Current Practice                 [Page 32]
1794
1795RFC 4646             Tags for Identifying Languages       September 2006
1796
1797
1798   o  The addition or maintenance of fields (generally of an
1799      informational nature) in Tag or Subtag records as described in
1800      Section 3.1 and subject to the stability provisions in
1801      Section 3.4.  This includes descriptions, comments, deprecation
1802      and preferred values for obsolete or withdrawn codes, or the
1803      addition of script or extlang information to primary language
1804      subtags.
1805
1806   o  The addition of records and related field value changes necessary
1807      to reflect assignments made by ISO 639, ISO 15924, ISO 3166, and
1808      UN M.49 as described in Section 3.4.
1809
1810   Subtags proposed for registration that would cause all or part of a
1811   grandfathered tag to become redundant but whose meaning conflicts
1812   with or alters the meaning of the grandfathered tag MUST be rejected.
1813
1814   This document leaves the decision on what subtags or changes to
1815   subtags are appropriate (or not) to the registration process
1816   described in Section 3.5.
1817
1818   Note: four-character primary language subtags are reserved to allow
1819   for the possibility of alpha4 codes in some future addition to the
1820   ISO 639 family of standards.
1821
1822   ISO 639 defines a maintenance agency for additions to and changes in
1823   the list of languages in ISO 639.  This agency is:
1824
1825   International Information Centre for Terminology (Infoterm)
1826   Aichholzgasse 6/12, AT-1120
1827   Wien, Austria
1828   Phone: +43 1 26 75 35 Ext. 312 Fax: +43 1 216 32 72
1829
1830   ISO 639-2 defines a maintenance agency for additions to and changes
1831   in the list of languages in ISO 639-2.  This agency is:
1832
1833   Library of Congress
1834   Network Development and MARC Standards Office
1835   Washington, D.C. 20540 USA
1836   Phone: +1 202 707 6237 Fax: +1 202 707 0115
1837   URL: http://www.loc.gov/standards/iso639-2
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849Phillips & Davis         Best Current Practice                 [Page 33]
1850
1851RFC 4646             Tags for Identifying Languages       September 2006
1852
1853
1854   The maintenance agency for ISO 3166 (country codes) is:
1855
1856   ISO 3166 Maintenance Agency
1857   c/o International Organization for Standardization
1858   Case postale 56
1859   CH-1211 Geneva 20 Switzerland
1860   Phone: +41 22 749 72 33 Fax: +41 22 749 73 49
1861   URL: http://www.iso.org/iso/en/prods-services/iso3166ma/index.html
1862
1863   The registration authority for ISO 15924 (script codes) is:
1864
1865   Unicode Consortium Box 391476
1866   Mountain View, CA 94039-1476, USA
1867   URL: http://www.unicode.org/iso15924
1868
1869   The Statistics Division of the United Nations Secretariat maintains
1870   the Standard Country or Area Codes for Statistical Use and can be
1871   reached at:
1872
1873   Statistical Services Branch
1874   Statistics Division
1875   United Nations, Room DC2-1620
1876   New York, NY 10017, USA
1877
1878   Fax: +1-212-963-0623
1879   E-mail: statistics@un.org
1880   URL: http://unstats.un.org/unsd/methods/m49/m49alpha.htm
1881
18823.7.  Extensions and Extensions Registry
1883
1884   Extension subtags are those introduced by single-character subtags
1885   ("singletons") other than 'x'.  They are reserved for the generation
1886   of identifiers that contain a language component and are compatible
1887   with applications that understand language tags.
1888
1889   The structure and form of extensions are defined by this document so
1890   that implementations can be created that are forward compatible with
1891   applications that might be created using singletons in the future.
1892   In addition, defining a mechanism for maintaining singletons will
1893   lend stability to this document by reducing the likely need for
1894   future revisions or updates.
1895
1896   Single-character subtags are assigned by IANA using the "IETF
1897   Consensus" policy defined by [RFC2434].  This policy requires the
1898   development of an RFC, which SHALL define the name, purpose,
1899   processes, and procedures for maintaining the subtags.  The
1900   maintaining or registering authority, including name, contact email,
1901
1902
1903
1904
1905Phillips & Davis         Best Current Practice                 [Page 34]
1906
1907RFC 4646             Tags for Identifying Languages       September 2006
1908
1909
1910   discussion list email, and URL location of the registry, MUST be
1911   indicated clearly in the RFC.  The RFC MUST specify or include each
1912   of the following:
1913
1914   o  The specification MUST reference the specific version or revision
1915      of this document that governs its creation and MUST reference this
1916      section of this document.
1917
1918   o  The specification and all subtags defined by the specification
1919      MUST follow the ABNF and other rules for the formation of tags and
1920      subtags as defined in this document.  In particular, it MUST
1921      specify that case is not significant and that subtags MUST NOT
1922      exceed eight characters in length.
1923
1924   o  The specification MUST specify a canonical representation.
1925
1926   o  The specification of valid subtags MUST be available over the
1927      Internet and at no cost.
1928
1929   o  The specification MUST be in the public domain or available via a
1930      royalty-free license acceptable to the IETF and specified in the
1931      RFC.
1932
1933   o  The specification MUST be versioned, and each version of the
1934      specification MUST be numbered, dated, and stable.
1935
1936   o  The specification MUST be stable.  That is, extension subtags,
1937      once defined by a specification, MUST NOT be retracted or change
1938      in meaning in any substantial way.
1939
1940   o  The specification MUST include in a separate section the
1941      registration form reproduced in this section (below) to be used in
1942      registering the extension upon publication as an RFC.
1943
1944   o  IANA MUST be informed of changes to the contact information and
1945      URL for the specification.
1946
1947   IANA will maintain a registry of allocated single-character
1948   (singleton) subtags.  This registry MUST use the record-jar format
1949   described by the ABNF in Section 3.1.  Upon publication of an
1950   extension as an RFC, the maintaining authority defined in the RFC
1951   MUST forward this registration form to iesg@ietf.org, who MUST
1952   forward the request to iana@iana.org.  The maintaining authority of
1953   the extension MUST maintain the accuracy of the record by sending an
1954   updated full copy of the record to iana@iana.org with the subject
1955   line "LANGUAGE TAG EXTENSION UPDATE" whenever content changes.  Only
1956   the 'Comments', 'Contact_Email', 'Mailing_List', and 'URL' fields MAY
1957   be modified in these updates.
1958
1959
1960
1961Phillips & Davis         Best Current Practice                 [Page 35]
1962
1963RFC 4646             Tags for Identifying Languages       September 2006
1964
1965
1966   Failure to maintain this record, maintain the corresponding registry,
1967   or meet other conditions imposed by this section of this document MAY
1968   be appealed to the IESG [RFC2028] under the same rules as other IETF
1969   decisions (see [RFC2026]) and MAY result in the authority to maintain
1970   the extension being withdrawn or reassigned by the IESG.
1971
1972   %%
1973   Identifier:
1974   Description:
1975   Comments:
1976   Added:
1977   RFC:
1978   Authority:
1979   Contact_Email:
1980   Mailing_List:
1981   URL:
1982   %%
1983
1984    Figure 6: Format of Records in the Language Tag Extensions Registry
1985
1986   'Identifier' contains the single-character subtag (singleton)
1987   assigned to the extension.  The Internet-Draft submitted to define
1988   the extension SHOULD specify which letter or digit to use, although
1989   the IESG MAY change the assignment when approving the RFC.
1990
1991   'Description' contains the name and description of the extension.
1992
1993   'Comments' is an OPTIONAL field and MAY contain a broader description
1994   of the extension.
1995
1996   'Added' contains the date the RFC was published in the "full-date"
1997   format specified in [RFC3339].  For example: 2004-06-28 represents
1998   June 28, 2004, in the Gregorian calendar.
1999
2000   'RFC' contains the RFC number assigned to the extension.
2001
2002   'Authority' contains the name of the maintaining authority for the
2003   extension.
2004
2005   'Contact_Email' contains the email address used to contact the
2006   maintaining authority.
2007
2008   'Mailing_List' contains the URL or subscription email address of the
2009   mailing list used by the maintaining authority.
2010
2011   'URL' contains the URL of the registry for this extension.
2012
2013
2014
2015
2016
2017Phillips & Davis         Best Current Practice                 [Page 36]
2018
2019RFC 4646             Tags for Identifying Languages       September 2006
2020
2021
2022   The determination of whether an Internet-Draft meets the above
2023   conditions and the decision to grant or withhold such authority rests
2024   solely with the IESG and is subject to the normal review and appeals
2025   process associated with the RFC process.
2026
2027   Extension authors are strongly cautioned that many (including most
2028   well-formed) processors will be unaware of any special relationships
2029   or meaning inherent in the order of extension subtags.  Extension
2030   authors SHOULD avoid subtag relationships or canonicalization
2031   mechanisms that interfere with matching or with length restrictions
2032   that sometimes exist in common protocols where the extension is used.
2033   In particular, applications MAY truncate the subtags in doing
2034   matching or in fitting into limited lengths, so it is RECOMMENDED
2035   that the most significant information be in the most significant
2036   (left-most) subtags and that the specification gracefully handle
2037   truncated subtags.
2038
2039   When a language tag is to be used in a specific, known, protocol, it
2040   is RECOMMENDED that the language tag not contain extensions not
2041   supported by that protocol.  In addition, note that some protocols
2042   MAY impose upper limits on the length of the strings used to store or
2043   transport the language tag.
2044
20453.8.  Initialization of the Registries
2046
2047   Upon adoption of this document, an initial version of the Language
2048   Subtag Registry containing the various subtags initially valid in a
2049   language tag is necessary.  This collection of subtags, along with a
2050   description of the process used to create it, is described by
2051   [RFC4645].  IANA SHALL publish the initial version of the registry
2052   described by this document from the content of [RFC4645].  Once
2053   published by IANA, the maintenance procedures, rules, and
2054   registration processes described in this document will be available
2055   for new registrations or updates.
2056
2057   Registrations that are in process under the rules defined in
2058   [RFC3066] when this document is adopted MAY be completed under the
2059   former rules, at the discretion of the Language Tag Reviewer (as
2060   described in [RFC3066]).  Until the IESG officially appoints a
2061   Language Subtag Reviewer, the existing Language Tag Reviewer SHALL
2062   serve as the Language Subtag Reviewer.
2063
2064   Any new registrations submitted using the RFC 3066 forms or format
2065   after the adoption of this document and publication of the registry
2066   by IANA MUST be rejected.
2067
2068
2069
2070
2071
2072
2073Phillips & Davis         Best Current Practice                 [Page 37]
2074
2075RFC 4646             Tags for Identifying Languages       September 2006
2076
2077
2078   An initial version of the Language Tag Extensions Registry described
2079   in Section 3.7 is also needed.  The Language Tag Extensions Registry
2080   SHALL be initialized with a single record containing a single field
2081   of type "File-Date" as a placeholder for future assignments.
2082
20834.  Formation and Processing of Language Tags
2084
2085   This section addresses how to use the information in the registry
2086   with the tag syntax to choose, form, and process language tags.
2087
20884.1.  Choice of Language Tag
2089
2090   One is sometimes faced with the choice between several possible tags
2091   for the same body of text.
2092
2093   Interoperability is best served when all users use the same language
2094   tag in order to represent the same language.  If an application has
2095   requirements that make the rules here inapplicable, then that
2096   application risks damaging interoperability.  It is strongly
2097   RECOMMENDED that users not define their own rules for language tag
2098   choice.
2099
2100   Subtags SHOULD only be used where they add useful distinguishing
2101   information; extraneous subtags interfere with the meaning,
2102   understanding, and processing of language tags.  In particular, users
2103   and implementations SHOULD follow the 'Prefix' and 'Suppress-Script'
2104   fields in the registry (defined in Section 3.1): these fields provide
2105   guidance on when specific additional subtags SHOULD (and SHOULD NOT)
2106   be used in a language tag.
2107
2108   Of particular note, many applications can benefit from the use of
2109   script subtags in language tags, as long as the use is consistent for
2110   a given context.  Script subtags were not formally defined in RFC
2111   3066 and their use can affect matching and subtag identification by
2112   implementations of RFC 3066, as these subtags appear between the
2113   primary language and region subtags.  For example, if a user requests
2114   content in an implementation of Section 2.5 of [RFC3066] using the
2115   language range "en-US", content labeled "en-Latn-US" will not match
2116   the request.  Therefore, it is important to know when script subtags
2117   will customarily be used and when they ought not be used.  In the
2118   registry, the Suppress-Script field helps ensure greater
2119   compatibility between the language tags generated according to the
2120   rules in this document and language tags and tag processors or
2121   consumers based on RFC 3066 by defining when users SHOULD NOT include
2122   a script subtag with a particular primary language subtag.
2123
2124
2125
2126
2127
2128
2129Phillips & Davis         Best Current Practice                 [Page 38]
2130
2131RFC 4646             Tags for Identifying Languages       September 2006
2132
2133
2134   Extended language subtags (type 'extlang' in the registry; see
2135   Section 3.1) also appear between the primary language and region
2136   subtags and are reserved for future standardization.  Applications
2137   might benefit from their judicious use in forming language tags in
2138   the future.  Similar recommendations are expected to apply to their
2139   use as apply to script subtags.
2140
2141   Standards, protocols, and applications that reference this document
2142   normatively but apply different rules to the ones given in this
2143   section MUST specify how the procedure varies from the one given
2144   here.
2145
2146   The choice of subtags used to form a language tag SHOULD be guided by
2147   the following rules:
2148
2149   1.  Use as precise a tag as possible, but no more specific than is
2150       justified.  Avoid using subtags that are not important for
2151       distinguishing content in an application.
2152
2153       *  For example, 'de' might suffice for tagging an email written
2154          in German, while "de-CH-1996" is probably unnecessarily
2155          precise for such a task.
2156
2157   2.  The script subtag SHOULD NOT be used to form language tags unless
2158       the script adds some distinguishing information to the tag.  The
2159       field 'Suppress-Script' in the primary language record in the
2160       registry indicates which script subtags do not add distinguishing
2161       information for most applications.
2162
2163       *  For example, the subtag 'Latn' should not be used with the
2164          primary language 'en' because nearly all English documents are
2165          written in the Latin script and it adds no distinguishing
2166          information.  However, if a document were written in English
2167          mixing Latin script with another script such as Braille
2168          ('Brai'), then it might be appropriate to choose to indicate
2169          both scripts to aid in content selection, such as the
2170          application of a style sheet.
2171
2172   3.  If a tag or subtag has a 'Preferred-Value' field in its registry
2173       entry, then the value of that field SHOULD be used to form the
2174       language tag in preference to the tag or subtag in which the
2175       preferred value appears.
2176
2177       *  For example, use 'he' for Hebrew in preference to 'iw'.
2178
2179
2180
2181
2182
2183
2184
2185Phillips & Davis         Best Current Practice                 [Page 39]
2186
2187RFC 4646             Tags for Identifying Languages       September 2006
2188
2189
2190   4.  The 'und' (Undetermined) primary language subtag SHOULD NOT be
2191       used to label content, even if the language is unknown.  Omitting
2192       the language tag altogether is preferred to using a tag with a
2193       primary language subtag of 'und'.  The 'und' subtag MAY be useful
2194       for protocols that require a language tag to be provided.  The
2195       'und' subtag MAY also be useful when matching language tags in
2196       certain situations.
2197
2198   5.  The 'mul' (Multiple) primary language subtag SHOULD NOT be used
2199       whenever the protocol allows the separate tags for multiple
2200       languages, as is the case for the Content-Language header in
2201       HTTP.  The 'mul' subtag conveys little useful information:
2202       content in multiple languages SHOULD individually tag the
2203       languages where they appear or otherwise indicate the actual
2204       language in preference to the 'mul' subtag.
2205
2206   6.  The same variant subtag SHOULD NOT be used more than once within
2207       a language tag.
2208
2209       *  For example, do not use "de-DE-1901-1901".
2210
2211   To ensure consistent backward compatibility, this document contains
2212   several provisions to account for potential instability in the
2213   standards used to define the subtags that make up language tags.
2214   These provisions mean that no language tag created under the rules in
2215   this document will become obsolete.
2216
22174.2.  Meaning of the Language Tag
2218
2219   The relationship between the tag and the information it relates to is
2220   defined by the context in which the tag appears.  Accordingly, this
2221   section gives only possible examples of its usage.
2222
2223   o  For a single information object, the associated language tags
2224      might be interpreted as the set of languages that is necessary for
2225      a complete comprehension of the complete object.  Example: Plain
2226      text documents.
2227
2228   o  For an aggregation of information objects, the associated language
2229      tags could be taken as the set of languages used inside components
2230      of that aggregation.  Examples: Document stores and libraries.
2231
2232   o  For information objects whose purpose is to provide alternatives,
2233      the associated language tags could be regarded as a hint that the
2234      content is provided in several languages and that one has to
2235      inspect each of the alternatives in order to find its language or
2236      languages.  In this case, the presence of multiple tags might not
2237      mean that one needs to be multi-lingual to get complete
2238
2239
2240
2241Phillips & Davis         Best Current Practice                 [Page 40]
2242
2243RFC 4646             Tags for Identifying Languages       September 2006
2244
2245
2246      understanding of the document.  Example: MIME multipart/
2247      alternative.
2248
2249   o  In markup languages, such as HTML and XML, language information
2250      can be added to each part of the document identified by the markup
2251      structure (including the whole document itself).  For example, one
2252      could write <span lang="fr">C'est la vie.</span> inside a
2253      Norwegian document; the Norwegian-speaking user could then access
2254      a French-Norwegian dictionary to find out what the marked section
2255      meant.  If the user were listening to that document through a
2256      speech synthesis interface, this formation could be used to signal
2257      the synthesizer to appropriately apply French text-to-speech
2258      pronunciation rules to that span of text, instead of applying the
2259      inappropriate Norwegian rules.
2260
2261   Language tags are related when they contain a similar sequence of
2262   subtags.  For example, if a language tag B contains language tag A as
2263   a prefix, then B is typically "narrower" or "more specific" than A.
2264   Thus, "zh-Hant-TW" is more specific than "zh-Hant".
2265
2266   This relationship is not guaranteed in all cases: specifically,
2267   languages that begin with the same sequence of subtags are NOT
2268   guaranteed to be mutually intelligible, although they might be.  For
2269   example, the tag "az" shares a prefix with both "az-Latn"
2270   (Azerbaijani written using the Latin script) and "az-Cyrl"
2271   (Azerbaijani written using the Cyrillic script).  A person fluent in
2272   one script might not be able to read the other, even though the text
2273   might be identical.  Content tagged as "az" most probably is written
2274   in just one script and thus might not be intelligible to a reader
2275   familiar with the other script.
2276
22774.3.  Length Considerations
2278
2279   [RFC3066] did not provide an upper limit on the size of language
2280   tags.  While RFC 3066 did define the semantics of particular subtags
2281   in such a way that most language tags consisted of language and
2282   region subtags with a combined total length of up to six characters,
2283   larger registered tags were not only possible but were actually
2284   registered.
2285
2286   Neither the language tag syntax nor other requirements in this
2287   document impose a fixed upper limit on the number of subtags in a
2288   language tag (and thus an upper bound on the size of a tag).  The
2289   language tag syntax suggests that, depending on the specific
2290   language, more subtags (and thus a longer tag) are sometimes
2291   necessary to completely identify the language for certain
2292   applications; thus, it is possible to envision long or complex subtag
2293   sequences.
2294
2295
2296
2297Phillips & Davis         Best Current Practice                 [Page 41]
2298
2299RFC 4646             Tags for Identifying Languages       September 2006
2300
2301
23024.3.1.  Working with Limited Buffer Sizes
2303
2304   Some applications and protocols are forced to allocate fixed buffer
2305   sizes or otherwise limit the length of a language tag.  A conformant
2306   implementation or specification MAY refuse to support the storage of
2307   language tags that exceed a specified length.  Any such limitation
2308   SHOULD be clearly documented, and such documentation SHOULD include
2309   what happens to longer tags (for example, whether an error value is
2310   generated or the language tag is truncated).  A protocol that allows
2311   tags to be truncated at an arbitrary limit, without giving any
2312   indication of what that limit is, has the potential for causing harm
2313   by changing the meaning of tags in substantial ways.
2314
2315   In practice, most language tags do not require more than a few
2316   subtags and will not approach reasonably sized buffer limitations;
2317   see Section 4.1.
2318
2319   Some specifications or protocols have limits on tag length but do not
2320   have a fixed length limitation.  For example, [RFC2231] has no
2321   explicit length limitation: the length available for the language tag
2322   is constrained by the length of other header components (such as the
2323   charset's name) coupled with the 76-character limit in [RFC2047].
2324   Thus, the "limit" might be 50 or more characters, but it could
2325   potentially be quite small.
2326
2327   The considerations for assigning a buffer limit are:
2328
2329      Implementations SHOULD NOT truncate language tags unless the
2330      meaning of the tag is purposefully being changed, or unless the
2331      tag does not fit into a limited buffer size specified by a
2332      protocol for storage or transmission.
2333
2334      Implementations SHOULD warn the user when a tag is truncated since
2335      truncation changes the semantic meaning of the tag.
2336
2337      Implementations of protocols or specifications that are space
2338      constrained but do not have a fixed limit SHOULD use the longest
2339      possible tag in preference to truncation.
2340
2341      Protocols or specifications that specify limited buffer sizes for
2342      language tags MUST allow for language tags of up to 33 characters.
2343
2344      Protocols or specifications that specify limited buffer sizes for
2345      language tags SHOULD allow for language tags of at least 42
2346      characters.
2347
2348
2349
2350
2351
2352
2353Phillips & Davis         Best Current Practice                 [Page 42]
2354
2355RFC 4646             Tags for Identifying Languages       September 2006
2356
2357
2358   The following illustration shows how the 42-character recommendation
2359   was derived.  The combination of language and extended language
2360   subtags was chosen for future compatibility.  At up to 15 characters,
2361   this combination is longer than the longest possible primary language
2362   subtag (8 characters):
2363
2364   language      =  3 (ISO 639-2; ISO 639-1 requires 2)
2365   extlang1      =  4 (each subsequent subtag includes '-')
2366   extlang2      =  4 (unlikely: needs prefix="language-extlang1")
2367   extlang3      =  4 (extremely unlikely)
2368   script        =  5 (if not suppressed: see Section 4.1)
2369   region        =  4 (UN M.49; ISO 3166 requires 3)
2370   variant1      =  9 (MUST have language as a prefix)
2371   variant2      =  9 (MUST have language-variant1 as a prefix)
2372
2373   total         = 42 characters
2374
2375              Figure 7: Derivation of the Limit on Tag Length
2376
23774.3.2.  Truncation of Language Tags
2378
2379   Truncation of a language tag alters the meaning of the tag, and thus
2380   SHOULD be avoided.  However, truncation of language tags is sometimes
2381   necessary due to limited buffer sizes.  Such truncation MUST NOT
2382   permit a subtag to be chopped off in the middle or the formation of
2383   invalid tags (for example, one ending with the "-" character).
2384
2385   This means that applications or protocols that truncate tags MUST do
2386   so by progressively removing subtags along with their preceding "-"
2387   from the right side of the language tag until the tag is short enough
2388   for the given buffer.  If the resulting tag ends with a single-
2389   character subtag, that subtag and its preceding "-" MUST also be
2390   removed.  For example:
2391
2392   Tag to truncate: zh-Latn-CN-variant1-a-extend1-x-wadegile-private1
2393   1. zh-Latn-CN-variant1-a-extend1-x-wadegile
2394   2. zh-Latn-CN-variant1-a-extend1
2395   3. zh-Latn-CN-variant1
2396   4. zh-Latn-CN
2397   5. zh-Latn
2398   6. zh
2399
2400                    Figure 8: Example of Tag Truncation
2401
2402
2403
2404
2405
2406
2407
2408
2409Phillips & Davis         Best Current Practice                 [Page 43]
2410
2411RFC 4646             Tags for Identifying Languages       September 2006
2412
2413
24144.4.  Canonicalization of Language Tags
2415
2416   Since a particular language tag is sometimes used by many processes,
2417   language tags SHOULD always be created or generated in a canonical
2418   form.
2419
2420   A language tag is in canonical form when:
2421
2422   1.  The tag is well-formed according the rules in Section 2.1 and
2423       Section 2.2.
2424
2425   2.  Subtags of type 'Region' that have a Preferred-Value mapping in
2426       the IANA registry (see Section 3.1) SHOULD be replaced with their
2427       mapped value.  Note: In rare cases, the mapped value will also
2428       have a Preferred-Value.
2429
2430   3.  Redundant or grandfathered tags that have a Preferred-Value
2431       mapping in the IANA registry (see Section 3.1) MUST be replaced
2432       with their mapped value.  These items either are deprecated
2433       mappings created before the adoption of this document (such as
2434       the mapping of "no-nyn" to "nn" or "i-klingon" to "tlh") or are
2435       the result of later registrations or additions to this document
2436       (for example, "zh-guoyu" might be mapped to a language-extlang
2437       combination such as "zh-cmn" by some future update of this
2438       document).
2439
2440   4.  Other subtags that have a Preferred-Value mapping in the IANA
2441       registry (see Section 3.1) MUST be replaced with their mapped
2442       value.  These items consist entirely of clerical corrections to
2443       ISO 639-1 in which the deprecated subtags have been maintained
2444       for compatibility purposes.
2445
2446   5.  If more than one extension subtag sequence exists, the extension
2447       sequences are ordered into case-insensitive ASCII order by
2448       singleton subtag.
2449
2450   Example: The language tag "en-A-aaa-B-ccc-bbb-x-xyz" is in canonical
2451   form, while "en-B-ccc-bbb-A-aaa-X-xyz" is well-formed but not in
2452   canonical form.
2453
2454   Example: The language tag "en-BU" (English as used in Burma) is not
2455   canonical because the 'BU' subtag has a canonical mapping to 'MM'
2456   (Myanmar), although the tag "en-BU" maintains its validity.
2457
2458   Canonicalization of language tags does not imply anything about the
2459   use of upper or lowercase letters when processing or comparing
2460   subtags (and as described in Section 2.1).  All comparisons MUST be
2461   performed in a case-insensitive manner.
2462
2463
2464
2465Phillips & Davis         Best Current Practice                 [Page 44]
2466
2467RFC 4646             Tags for Identifying Languages       September 2006
2468
2469
2470   When performing canonicalization of language tags, processors MAY
2471   regularize the case of the subtags (that is, this process is
2472   OPTIONAL), following the case used in the registry.  Note that this
2473   corresponds to the following casing rules: uppercase all non-initial
2474   two-letter subtags; titlecase all non-initial four-letter subtags;
2475   lowercase everything else.
2476
2477   Note: Case folding of ASCII letters in certain locales, unless
2478   carefully handled, sometimes produces non-ASCII character values.
2479   The Unicode Character Database file "SpecialCasing.txt" defines the
2480   specific cases that are known to cause problems with this.  In
2481   particular, the letter 'i' (U+0069) in Turkish and Azerbaijani is
2482   uppercased to U+0130 (LATIN CAPITAL LETTER I WITH DOT ABOVE).
2483   Implementers SHOULD specify a locale-neutral casing operation to
2484   ensure that case folding of subtags does not produce this value,
2485   which is illegal in language tags.  For example, if one were to
2486   uppercase the region subtag 'in' using Turkish locale rules, the
2487   sequence U+0130 U+004E would result instead of the expected 'IN'.
2488
2489   Note: if the field 'Deprecated' appears in a registry record without
2490   an accompanying 'Preferred-Value' field, then that tag or subtag is
2491   deprecated without a replacement.  Validating processors SHOULD NOT
2492   generate tags that include these values, although the values are
2493   canonical when they appear in a language tag.
2494
2495   An extension MUST define any relationships that exist between the
2496   various subtags in the extension and thus MAY define an alternate
2497   canonicalization scheme for the extension's subtags.  Extensions MAY
2498   define how the order of the extension's subtags are interpreted.  For
2499   example, an extension could define that its subtags are in canonical
2500   order when the subtags are placed into ASCII order: that is,
2501   "en-a-aaa-bbb-ccc" instead of "en-a-ccc-bbb-aaa".  Another extension
2502   might define that the order of the subtags influences their semantic
2503   meaning (so that "en-b-ccc-bbb-aaa" has a different value from
2504   "en-b-aaa-bbb-ccc").  However, extension specifications SHOULD be
2505   designed so that they are tolerant of the typical processes described
2506   in Section 3.7.
2507
25084.5.  Considerations for Private Use Subtags
2509
2510   Private use subtags, like all other subtags, MUST conform to the
2511   format and content constraints in the ABNF.  Private use subtags have
2512   no meaning outside the private agreement between the parties that
2513   intend to use or exchange language tags that employ them.  The same
2514   subtags MAY be used with a different meaning under a separate private
2515   agreement.  They SHOULD NOT be used where alternatives exist and
2516   SHOULD NOT be used in content or protocols intended for general use.
2517
2518
2519
2520
2521Phillips & Davis         Best Current Practice                 [Page 45]
2522
2523RFC 4646             Tags for Identifying Languages       September 2006
2524
2525
2526   Private use subtags are simply useless for information exchange
2527   without prior arrangement.  The value and semantic meaning of private
2528   use tags and of the subtags used within such a language tag are not
2529   defined by this document.
2530
2531   Subtags defined in the IANA registry as having a specific private use
2532   meaning convey more information that a purely private use tag
2533   prefixed by the singleton subtag 'x'.  For applications, this
2534   additional information MAY be useful.
2535
2536   For example, the region subtags 'AA', 'ZZ', and in the ranges
2537   'QM'-'QZ' and 'XA'-'XZ' (derived from ISO 3166 private use codes) MAY
2538   be used to form a language tag.  A tag such as "zh-Hans-XQ" conveys a
2539   great deal of public, interchangeable information about the language
2540   material (that it is Chinese in the simplified Chinese script and is
2541   suitable for some geographic region 'XQ').  While the precise
2542   geographic region is not known outside of private agreement, the tag
2543   conveys far more information than an opaque tag such as "x-someLang",
2544   which contains no information about the language subtag or script
2545   subtag outside of the private agreement.
2546
2547   However, in some cases content tagged with private use subtags MAY
2548   interact with other systems in a different and possibly unsuitable
2549   manner compared to tags that use opaque, privately defined subtags,
2550   so the choice of the best approach sometimes depends on the
2551   particular domain in question.
2552
25535.  IANA Considerations
2554
2555   This section deals with the processes and requirements necessary for
2556   IANA to undertake to maintain the subtag and extension registries as
2557   defined by this document and in accordance with the requirements of
2558   [RFC2434].
2559
2560   The impact on the IANA maintainers of the two registries defined by
2561   this document will be a small increase in the frequency of new
2562   entries or updates.
2563
25645.1.  Language Subtag Registry
2565
2566   Upon adoption of this document, the registry will be initialized by a
2567   companion document: [RFC4645].  The criteria and process for
2568   selecting the initial set of records are described in that document.
2569   The initial set of records represents no impact on IANA, since the
2570   work to create it will be performed externally.
2571
2572
2573
2574
2575
2576
2577Phillips & Davis         Best Current Practice                 [Page 46]
2578
2579RFC 4646             Tags for Identifying Languages       September 2006
2580
2581
2582   The new registry MUST be listed under "Language Tags" at
2583   <http://www.iana.org/numbers.html>, replacing the existing
2584   registrations defined by [RFC3066].  The existing set of registration
2585   forms and RFC 3066 registrations MUST be relabeled as "Language Tags
2586   (Obsolete)" and maintained (but not added to or modified).
2587
2588   Future work on the Language Subtag Registry SHALL be limited to
2589   inserting or replacing whole records preformatted for IANA by the
2590   Language Subtag Reviewer as described in Section 3.3 of this document
2591   and archiving the forwarded registration form.
2592
2593   Each record MUST be sent to iana@iana.org with a subject line
2594   indicating whether the enclosed record is an insertion of a new
2595   record (indicated by the word "INSERT" in the subject line) or a
2596   replacement of an existing record (indicated by the word "MODIFY" in
2597   the subject line).  Records MUST NOT be deleted from the registry.
2598   IANA MUST place any inserted or modified records into the appropriate
2599   section of the language subtag registry, grouping the records by
2600   their 'Type' field.  Inserted records MAY be placed anywhere in the
2601   appropriate section; there is no guarantee of the order of the
2602   records beyond grouping them together by 'Type'.  Modified records
2603   MUST overwrite the record they replace.
2604
2605   Included in any request to insert or modify records MUST be a new
2606   File-Date record.  This record MUST be placed first in the registry.
2607   In the event that the File-Date record present in the registry has a
2608   later date than the record being inserted or modified, the existing
2609   record MUST be preserved.
2610
26115.2.  Extensions Registry
2612
2613   The Language Tag Extensions Registry will also be generated and sent
2614   to IANA as described in Section 3.7.  This registry can contain at
2615   most 35 records, and thus changes to this registry are expected to be
2616   very infrequent.
2617
2618   Future work by IANA on the Language Tag Extensions Registry is
2619   limited to two cases.  First, the IESG MAY request that new records
2620   be inserted into this registry from time to time.  These requests
2621   MUST include the record to insert in the exact format described in
2622   Section 3.7.  In addition, there MAY be occasional requests from the
2623   maintaining authority for a specific extension to update the contact
2624   information or URLs in the record.  These requests MUST include the
2625   complete, updated record.  IANA is not responsible for validating the
2626   information provided, only that it is properly formatted.  It should
2627   reasonably be seen to come from the maintaining authority named in
2628   the record present in the registry.
2629
2630
2631
2632
2633Phillips & Davis         Best Current Practice                 [Page 47]
2634
2635RFC 4646             Tags for Identifying Languages       September 2006
2636
2637
26386.  Security Considerations
2639
2640   Language tags used in content negotiation, like any other information
2641   exchanged on the Internet, might be a source of concern because they
2642   might be used to infer the nationality of the sender, and thus
2643   identify potential targets for surveillance.
2644
2645   This is a special case of the general problem that anything sent is
2646   visible to the receiving party and possibly to third parties as well.
2647   It is useful to be aware that such concerns can exist in some cases.
2648
2649   The evaluation of the exact magnitude of the threat, and any possible
2650   countermeasures, is left to each application protocol (see BCP 72
2651   [RFC3552] for best current practice guidance on security threats and
2652   defenses).
2653
2654   The language tag associated with a particular information item is of
2655   no consequence whatsoever in determining whether that content might
2656   contain possible homographs.  The fact that a text is tagged as being
2657   in one language or using a particular script subtag provides no
2658   assurance whatsoever that it does not contain characters from scripts
2659   other than the one(s) associated with or specified by that language
2660   tag.
2661
2662   Since there is no limit to the number of variant, private use, and
2663   extension subtags, and consequently no limit on the possible length
2664   of a tag, implementations need to guard against buffer overflow
2665   attacks.  See Section 4.3 for details on language tag truncation,
2666   which can occur as a consequence of defenses against buffer overflow.
2667
2668   Although the specification of valid subtags for an extension (see
2669   Section 3.7) MUST be available over the Internet, implementations
2670   SHOULD NOT mechanically depend on it being always accessible, to
2671   prevent denial-of-service attacks.
2672
26737.  Character Set Considerations
2674
2675   The syntax in this document requires that language tags use only the
2676   characters A-Z, a-z, 0-9, and HYPHEN-MINUS, which are present in most
2677   character sets, so the composition of language tags should not have
2678   any character set issues.
2679
2680   Rendering of characters based on the content of a language tag is not
2681   addressed in this memo.  Historically, some languages have relied on
2682   the use of specific character sets or other information in order to
2683   infer how a specific character should be rendered (notably this
2684   applies to language- and culture-specific variations of Han
2685   ideographs as used in Japanese, Chinese, and Korean).  When language
2686
2687
2688
2689Phillips & Davis         Best Current Practice                 [Page 48]
2690
2691RFC 4646             Tags for Identifying Languages       September 2006
2692
2693
2694   tags are applied to spans of text, rendering engines sometimes use
2695   that information in deciding which font to use in the absence of
2696   other information, particularly where languages with distinct writing
2697   traditions use the same characters.
2698
26998.  Changes from RFC 3066
2700
2701   The main goals for this revision of language tags were the following:
2702
2703   *Compatibility.* All RFC 3066 language tags (including those in the
2704   IANA registry) remain valid in this specification.  The changes in
2705   this document represent additional constraints on language tags.
2706   That is, in no case is the syntax more permissive and processors
2707   based on the ABNF and other provisions of RFC 3066 (such as those
2708   described in [XMLSchema]) will be able to process the tags described
2709   by this document.  In addition, this document defines language tags
2710   in such as way as to ensure future compatibility.
2711
2712   *Stability.* Because of changes in the past in the underlying ISO
2713   standards, a valid RFC 3066 language tag could become invalid or have
2714   its meaning change.  This has the potential of invalidating content
2715   that may have an extensive shelf-life.  In this specification, once a
2716   language tag is valid, it remains valid forever.
2717
2718   *Validity.* The structure of language tags defined by this document
2719   makes it possible to determine if a particular tag is well-formed
2720   without regard for the actual content or "meaning" of the tag as a
2721   whole.  This is important because the registry grows and underlying
2722   standards change over time.  In addition, it must be possible to
2723   determine if a tag is valid (or not) for a given point in time in
2724   order to provide reproducible, testable results.  This process must
2725   not be error-prone; otherwise implementations might give different
2726   results.  By having an authoritative registry with specific
2727   versioning information, the validity of language tags at any point in
2728   time can be precisely determined (instead of interpolating values
2729   from many separate sources).
2730
2731   *Utility.* It is sometimes important to be able to differentiate
2732   between written forms of a language -- for many implementations this
2733   is more important than distinguishing between the spoken variants of
2734   a language.  Languages are written in a wide variety of different
2735   scripts, so this document provides for the generative use of ISO
2736   15924 script codes.  Like the generative use of ISO language and
2737   country codes in RFC 3066, this allows combinations to be produced
2738   without resorting to the registration process.  The addition of UN
2739   M.49 codes provides for the generation of language tags with regional
2740   scope, which is also required by some applications.
2741
2742
2743
2744
2745Phillips & Davis         Best Current Practice                 [Page 49]
2746
2747RFC 4646             Tags for Identifying Languages       September 2006
2748
2749
2750   The recast of the registry from containing whole language tags to
2751   subtags is a key part of this.  An important feature of RFC 3066 was
2752   that it allowed generative use of subtags.  This allows people to
2753   meaningfully use generated tags, without the delays in registering
2754   whole tags or the need to register all of the combinations that might
2755   be useful.
2756
2757   The choice of placing the extended language and script subtags
2758   between the primary language and region subtags was widely debated.
2759   This design was chosen because the prevalent matching and content
2760   negotiation schemes rely on the subtags being arranged in order of
2761   increasing specificity.  That is, the subtags that mark a greater
2762   barrier to mutual intelligibility appear left-most in a tag.  For
2763   example, when selecting content written in Azerbaijani, the script
2764   (Arabic, Cyrillic, or Latin) represents a greater barrier to
2765   understanding than any regional variations (those associated with
2766   Azerbaijan or Iran, for example).  Individuals who prefer documents
2767   in a particular script, but can deal with the minor regional
2768   differences, can therefore select appropriate content.  Applications
2769   that do not deal with written content will continue to omit these
2770   subtags.
2771
2772   *Extensibility.* Because of the widespread use of language tags, it
2773   is disruptive to have periodic revisions of the core specification,
2774   even in the face of demonstrated need.  The extension mechanism
2775   provides for a way for independent RFCs to define extensions to
2776   language tags.  These extensions have a very constrained, well-
2777   defined structure that prevents extensions from interfering with
2778   implementations of language tags defined in this document.
2779
2780   The document also anticipates features of ISO 639-3 with the addition
2781   of the extended language subtags, as well as the possibility of other
2782   ISO 639 parts becoming useful for the formation of language tags in
2783   the future.
2784
2785   The use and definition of private use tags have also been modified,
2786   to allow people to use private use subtags to extend or modify
2787   defined tags and to move as much information as possible out of
2788   private use and into the regular structure.
2789
2790   The goal for each of these modifications is to reduce or eliminate
2791   the need for future revisions of this document.
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801Phillips & Davis         Best Current Practice                 [Page 50]
2802
2803RFC 4646             Tags for Identifying Languages       September 2006
2804
2805
2806   The specific changes in this document to meet these goals are:
2807
2808   o  Defines the ABNF and rules for subtags so that the category of all
2809      subtags can be determined without reference to the registry.
2810
2811   o  Adds the concept of well-formed vs. validating processors,
2812      defining the rules by which an implementation can claim to be one
2813      or the other.
2814
2815   o  Replaces the IANA language tag registry with a language subtag
2816      registry that provides a complete list of valid subtags in the
2817      IANA registry.  This allows for robust implementation and ease of
2818      maintenance.  The language subtag registry becomes the canonical
2819      source for forming language tags.
2820
2821   o  Provides a process that guarantees stability of language tags, by
2822      handling reuse of values by ISO 639, ISO 15924, and ISO 3166 in
2823      the event that they register a previously used value for a new
2824      purpose.
2825
2826   o  Allows ISO 15924 script code subtags and allows them to be used
2827      generatively.  Defines a method for indicating in the registry
2828      when script subtags are necessary for a given language tag.
2829
2830   o  Adds the concept of a variant subtag and allows variants to be
2831      used generatively.
2832
2833   o  Adds the ability to use a class of UN M.49 tags for supra-national
2834      regions and to resolve conflicts in the assignment of ISO 3166
2835      codes.
2836
2837   o  Defines the private use tags in ISO 639, ISO 15924, and ISO 3166
2838      as the mechanism for creating private use language, script, and
2839      region subtags, respectively.
2840
2841   o  Adds a well-defined extension mechanism.
2842
2843   o  Defines an extended language subtag, possibly for use with certain
2844      anticipated features of ISO 639-3.
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857Phillips & Davis         Best Current Practice                 [Page 51]
2858
2859RFC 4646             Tags for Identifying Languages       September 2006
2860
2861
28629.  References
2863
28649.1.  Normative References
2865
2866   [ISO10646]     International Organization for Standardization,
2867                  "ISO/IEC 10646:2003. Information technology --
2868                  Universal Multiple-Octet Coded Character Set (UCS)",
2869                  2003.
2870
2871   [ISO15924]     International Organization for Standardization, "ISO
2872                  15924:2004. Information and documentation -- Codes for
2873                  the representation of names of scripts", January 2004.
2874
2875   [ISO3166-1]    International Organization for Standardization, "ISO
2876                  3166-1:1997. Codes for the representation of names of
2877                  countries and their subdivisions -- Part 1: Country
2878                  codes", 1997.
2879
2880   [ISO639-1]     International Organization for Standardization, "ISO
2881                  639-1:2002. Codes for the representation of names of
2882                  languages -- Part 1: Alpha-2 code", 2002.
2883
2884   [ISO639-2]     International Organization for Standardization, "ISO
2885                  639-2:1998. Codes for the representation of names of
2886                  languages -- Part 2: Alpha-3 code, first edition",
2887                  1998.
2888
2889   [ISO646]       International Organization for Standardization,
2890                  "ISO/IEC 646:1991, Information technology -- ISO 7-bit
2891                  coded character set for information interchange.",
2892                  1991.
2893
2894   [RFC2026]      Bradner, S., "The Internet Standards Process --
2895                  Revision 3", BCP 9, RFC 2026, October 1996.
2896
2897   [RFC2028]      Hovey, R. and S. Bradner, "The Organizations Involved
2898                  in the IETF Standards Process", BCP 11, RFC 2028,
2899                  October 1996.
2900
2901   [RFC2119]      Bradner, S., "Key words for use in RFCs to Indicate
2902                  Requirement Levels", BCP 14, RFC 2119, March 1997.
2903
2904   [RFC2434]      Narten, T. and H. Alvestrand, "Guidelines for Writing
2905                  an IANA Considerations Section in RFCs", BCP 26,
2906                  RFC 2434, October 1998.
2907
2908
2909
2910
2911
2912
2913Phillips & Davis         Best Current Practice                 [Page 52]
2914
2915RFC 4646             Tags for Identifying Languages       September 2006
2916
2917
2918   [RFC2860]      Carpenter, B., Baker, F., and M. Roberts, "Memorandum
2919                  of Understanding Concerning the Technical Work of the
2920                  Internet Assigned Numbers Authority", RFC 2860,
2921                  June 2000.
2922
2923   [RFC3339]      Klyne, G., Ed. and C. Newman, "Date and Time on the
2924                  Internet: Timestamps", RFC 3339, July 2002.
2925
2926   [RFC4234]      Crocker, D., Ed. and P. Overell, "Augmented BNF for
2927                  Syntax Specifications: ABNF", RFC 4234, October 2005.
2928
2929   [UN_M.49]      Statistics Division, United Nations, "Standard Country
2930                  or Area Codes for Statistical Use", UN Standard
2931                  Country or Area Codes for Statistical Use, Revision 4
2932                  (United Nations publication, Sales No. 98.XVII.9,
2933                  June 1999.
2934
29359.2.  Informative References
2936
2937   [RFC1766]      Alvestrand, H., "Tags for the Identification of
2938                  Languages", RFC 1766, March 1995.
2939
2940   [RFC2047]      Moore, K., "MIME (Multipurpose Internet Mail
2941                  Extensions) Part Three: Message Header Extensions for
2942                  Non-ASCII Text", RFC 2047, November 1996.
2943
2944   [RFC2231]      Freed, N. and K. Moore, "MIME Parameter Value and
2945                  Encoded Word Extensions: Character Sets, Languages,
2946                  and Continuations", RFC 2231, November 1997.
2947
2948   [RFC2781]      Hoffman, P. and F. Yergeau, "UTF-16, an encoding of
2949                  ISO 10646", RFC 2781, February 2000.
2950
2951   [RFC3066]      Alvestrand, H., "Tags for the Identification of
2952                  Languages", BCP 47, RFC 3066, January 2001.
2953
2954   [RFC3552]      Rescorla, E. and B. Korver, "Guidelines for Writing
2955                  RFC Text on Security Considerations", BCP 72,
2956                  RFC 3552, July 2003.
2957
2958   [RFC4645]      Ewell, D., Ed., "Initial Language Subtag Registry",
2959                  RFC 4645, September 2006.
2960
2961   [RFC4647]      Phillips, A., Ed. and M. Davis, Ed., "Matching of
2962                  Language Tags", BCP 47, RFC 4647, September 2006.
2963
2964
2965
2966
2967
2968
2969Phillips & Davis         Best Current Practice                 [Page 53]
2970
2971RFC 4646             Tags for Identifying Languages       September 2006
2972
2973
2974   [Unicode]      Unicode Consortium, "The Unicode Standard, Version
2975                  5.0", Boston, MA, Addison-Wesley, 2007. ISBN 0-321-
2976                  48091-0.
2977
2978   [XML10]        Bray (et al), T., "Extensible Markup Language (XML)
2979                  1.0", 02 2004.
2980
2981   [XMLSchema]    Biron, P., Ed. and A. Malhotra, Ed., "XML Schema Part
2982                  2: Datatypes Second Edition", 10 2004, <
2983                  http://www.w3.org/TR/xmlschema-2/>.
2984
2985   [iso639.prin]  ISO 639 Joint Advisory Committee, "ISO 639 Joint
2986                  Advisory Committee:  Working principles for ISO 639
2987                  maintenance", March 2000, <http://www.loc.gov/
2988                  standards/iso639-2/iso639jac_n3r.html>.
2989
2990   [record-jar]   Raymond, E., "The Art of Unix Programming", 2003,
2991                  <urn:isbn:0-13-142901-9>.
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025Phillips & Davis         Best Current Practice                 [Page 54]
3026
3027RFC 4646             Tags for Identifying Languages       September 2006
3028
3029
3030Appendix A.  Acknowledgements
3031
3032   Any list of contributors is bound to be incomplete; please regard the
3033   following as only a selection from the group of people who have
3034   contributed to make this document what it is today.
3035
3036   The contributors to RFC 3066 and RFC 1766, the precursors of this
3037   document, made enormous contributions directly or indirectly to this
3038   document and are generally responsible for the success of language
3039   tags.
3040
3041   The following people (in alphabetical order) contributed to this
3042   document or to RFCs 1766 and 3066:
3043
3044   Glenn Adams, Harald Tveit Alvestrand, Tim Berners-Lee, Marc Blanchet,
3045   Nathaniel Borenstein, Karen Broome, Eric Brunner, Sean M. Burke, M.T.
3046   Carrasco Benitez, Jeremy Carroll, John Clews, Jim Conklin, Peter
3047   Constable, John Cowan, Mark Crispin, Dave Crocker, Elwyn Davies,
3048   Martin Duerst, Frank Ellerman, Michael Everson, Doug Ewell, Ned
3049   Freed, Tim Goodwin, Dirk-Willem van Gulik, Marion Gunn, Joel Halpren,
3050   Elliotte Rusty Harold, Paul Hoffman, Scott Hollenbeck, Richard
3051   Ishida, Olle Jarnefors, Kent Karlsson, John Klensin, Erkki
3052   Kolehmainen, Alain LaBonte, Eric Mader, Ira McDonald, Keith Moore,
3053   Chris Newman, Masataka Ohta, Dylan Pierce, Randy Presuhn, George
3054   Rhoten, Felix Sasaki, Markus Scherer, Keld Jorn Simonsen, Thierry
3055   Sourbier, Otto Stolz, Tex Texin, Andrea Vine, Rhys Weatherley, Misha
3056   Wolf, Francois Yergeau and many, many others.
3057
3058   Very special thanks must go to Harald Tveit Alvestrand, who
3059   originated RFCs 1766 and 3066, and without whom this document would
3060   not have been possible.  Special thanks must go to Michael Everson,
3061   who has served as Language Tag Reviewer for almost the complete
3062   period since the publication of RFC 1766.  Special thanks to Doug
3063   Ewell, for his production of the first complete subtag registry, and
3064   his work in producing a test parser for verifying language tags.
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081Phillips & Davis         Best Current Practice                 [Page 55]
3082
3083RFC 4646             Tags for Identifying Languages       September 2006
3084
3085
3086Appendix B.  Examples of Language Tags (Informative)
3087
3088   Simple language subtag:
3089
3090      de (German)
3091
3092      fr (French)
3093
3094      ja (Japanese)
3095
3096      i-enochian (example of a grandfathered tag)
3097
3098   Language subtag plus Script subtag:
3099
3100      zh-Hant (Chinese written using the Traditional Chinese script)
3101
3102      zh-Hans (Chinese written using the Simplified Chinese script)
3103
3104      sr-Cyrl (Serbian written using the Cyrillic script)
3105
3106      sr-Latn (Serbian written using the Latin script)
3107
3108   Language-Script-Region:
3109
3110      zh-Hans-CN (Chinese written using the Simplified script as used in
3111      mainland China)
3112
3113      sr-Latn-CS (Serbian written using the Latin script as used in
3114      Serbia and Montenegro)
3115
3116   Language-Variant:
3117
3118      sl-rozaj (Resian dialect of Slovenian
3119
3120      sl-nedis (Nadiza dialect of Slovenian)
3121
3122   Language-Region-Variant:
3123
3124      de-CH-1901 (German as used in Switzerland using the 1901 variant
3125      [orthography])
3126
3127      sl-IT-nedis (Slovenian as used in Italy, Nadiza dialect)
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137Phillips & Davis         Best Current Practice                 [Page 56]
3138
3139RFC 4646             Tags for Identifying Languages       September 2006
3140
3141
3142   Language-Script-Region-Variant:
3143
3144      sl-Latn-IT-nedis (Nadiza dialect of Slovenian written using the
3145      Latin script as used in Italy.  Note that this tag is NOT
3146      RECOMMENDED because subtag 'sl' has a Suppress-Script value of
3147      'Latn')
3148
3149   Language-Region:
3150
3151      de-DE (German for Germany)
3152
3153      en-US (English as used in the United States)
3154
3155      es-419 (Spanish appropriate for the Latin America and Caribbean
3156      region using the UN region code)
3157
3158   Private use subtags:
3159
3160      de-CH-x-phonebk
3161
3162      az-Arab-x-AZE-derbend
3163
3164   Extended language subtags (examples ONLY: extended languages MUST be
3165   defined by revision or update to this document):
3166
3167      zh-min
3168
3169      zh-min-nan-Hant-CN
3170
3171   Private use registry values:
3172
3173      x-whatever (private use using the singleton 'x')
3174
3175      qaa-Qaaa-QM-x-southern (all private tags)
3176
3177      de-Qaaa (German, with a private script)
3178
3179      sr-Latn-QM (Serbian, Latin-script, private region)
3180
3181      sr-Qaaa-CS (Serbian, private script, for Serbia and Montenegro)
3182
3183   Tags that use extensions (examples ONLY: extensions MUST be defined
3184   by revision or update to this document or by RFC):
3185
3186      en-US-u-islamCal
3187
3188      zh-CN-a-myExt-x-private
3189
3190
3191
3192
3193Phillips & Davis         Best Current Practice                 [Page 57]
3194
3195RFC 4646             Tags for Identifying Languages       September 2006
3196
3197
3198      en-a-myExt-b-another
3199
3200   Some Invalid Tags:
3201
3202      de-419-DE (two region tags)
3203
3204      a-DE (use of a single-character subtag in primary position; note
3205      that there are a few grandfathered tags that start with "i-" that
3206      are valid)
3207
3208      ar-a-aaa-b-bbb-a-ccc (two extensions with same single-letter
3209      prefix)
3210
3211Authors' Addresses
3212
3213   Addison Phillips (Editor)
3214   Yahoo! Inc.
3215
3216   EMail: addison@inter-locale.com
3217
3218
3219   Mark Davis (Editor)
3220   Google
3221
3222   EMail: mark.davis@macchiato.com or mark.davis@google.com
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249Phillips & Davis         Best Current Practice                 [Page 58]
3250
3251RFC 4646             Tags for Identifying Languages       September 2006
3252
3253
3254Full Copyright Statement
3255
3256   Copyright (C) The Internet Society (2006).
3257
3258   This document is subject to the rights, licenses and restrictions
3259   contained in BCP 78, and except as set forth therein, the authors
3260   retain all their rights.
3261
3262   This document and the information contained herein are provided on an
3263   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
3264   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
3265   ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
3266   INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
3267   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
3268   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
3269
3270Intellectual Property
3271
3272   The IETF takes no position regarding the validity or scope of any
3273   Intellectual Property Rights or other rights that might be claimed to
3274   pertain to the implementation or use of the technology described in
3275   this document or the extent to which any license under such rights
3276   might or might not be available; nor does it represent that it has
3277   made any independent effort to identify any such rights.  Information
3278   on the procedures with respect to rights in RFC documents can be
3279   found in BCP 78 and BCP 79.
3280
3281   Copies of IPR disclosures made to the IETF Secretariat and any
3282   assurances of licenses to be made available, or the result of an
3283   attempt made to obtain a general license or permission for the use of
3284   such proprietary rights by implementers or users of this
3285   specification can be obtained from the IETF on-line IPR repository at
3286   http://www.ietf.org/ipr.
3287
3288   The IETF invites any interested party to bring to its attention any
3289   copyrights, patents or patent applications, or other proprietary
3290   rights that may cover technology that may be required to implement
3291   this standard.  Please address the information to the IETF at
3292   ietf-ipr@ietf.org.
3293
3294Acknowledgement
3295
3296   Funding for the RFC Editor function is provided by the IETF
3297   Administrative Support Activity (IASA).
3298
3299
3300
3301
3302
3303
3304
3305Phillips & Davis         Best Current Practice                 [Page 59]
3306
3307========================================================================
3308
3309
3310
3311
3312
3313
3314Network Working Group                                   A. Phillips, Ed.
3315Request for Comments: 4647                                   Yahoo! Inc.
3316BCP: 47                                                    M. Davis, Ed.
3317Obsoletes: 3066                                                   Google
3318Category: Best Current Practice                           September 2006
3319
3320
3321                       Matching of Language Tags
3322
3323Status of This Memo
3324
3325   This document specifies an Internet Best Current Practices for the
3326   Internet Community, and requests discussion and suggestions for
3327   improvements.  Distribution of this memo is unlimited.
3328
3329Copyright Notice
3330
3331   Copyright (C) The Internet Society (2006).
3332
3333Abstract
3334
3335   This document describes a syntax, called a "language-range", for
3336   specifying items in a user's list of language preferences.  It also
3337   describes different mechanisms for comparing and matching these to
3338   language tags.  Two kinds of matching mechanisms, filtering and
3339   lookup, are defined.  Filtering produces a (potentially empty) set of
3340   language tags, whereas lookup produces a single language tag.
3341   Possible applications include language negotiation or content
3342   selection.  This document, in combination with RFC 4646, replaces RFC
3343   3066, which replaced RFC 1766.
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365Phillips & Davis         Best Current Practice                  [Page 1]
3366
3367RFC 4647               Matching of Language Tags          September 2006
3368
3369
3370Table of Contents
3371
3372   1. Introduction ....................................................3
3373   2. The Language Range ..............................................3
3374      2.1. Basic Language Range .......................................4
3375      2.2. Extended Language Range ....................................4
3376      2.3. The Language Priority List .................................5
3377   3. Types of Matching ...............................................6
3378      3.1. Choosing a Matching Scheme .................................6
3379      3.2. Implementation Considerations ..............................7
3380      3.3. Filtering ..................................................8
3381           3.3.1. Basic Filtering .....................................9
3382           3.3.2. Extended Filtering .................................10
3383      3.4. Lookup ....................................................12
3384           3.4.1. Default Values .....................................14
3385   4. Other Considerations ...........................................15
3386      4.1. Choosing Language Ranges ..................................15
3387      4.2. Meaning of Language Tags and Ranges .......................16
3388      4.3. Considerations for Private-Use Subtags ....................17
3389      4.4. Length Considerations for Language Ranges .................17
3390   5. Security Considerations ........................................17
3391   6. Character Set Considerations ...................................17
3392   7. References .....................................................18
3393      7.1. Normative References ......................................18
3394      7.2. Informative References ....................................18
3395   Appendix A. Acknowledgements ......................................19
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421Phillips & Davis         Best Current Practice                  [Page 2]
3422
3423RFC 4647               Matching of Language Tags          September 2006
3424
3425
34261.  Introduction
3427
3428   Human beings on our planet have, past and present, used a number of
3429   languages.  There are many reasons why one would want to identify the
3430   language used when presenting or requesting information.
3431
3432   Applications, protocols, or specifications that use language
3433   identifiers, such as the language tags defined in [RFC4646],
3434   sometimes need to match language tags to a user's language
3435   preferences.
3436
3437   This document defines a syntax (called a language range (Section 2))
3438   for specifying items in the user's list of language preferences
3439   (called a language priority list (Section 2.3)), as well as several
3440   schemes for selecting or filtering sets of language tags by comparing
3441   the language tags to the user's preferences.  Applications,
3442   protocols, or specifications will have varying needs and requirements
3443   that affect the choice of a suitable matching scheme.
3444
3445   This document describes how to indicate a user's preferences using
3446   language ranges, three schemes for matching these ranges to a set of
3447   language tags, and the various practical considerations that apply to
3448   implementing and using these schemes.
3449
3450   This document, in combination with [RFC4646], replaces [RFC3066],
3451   which replaced [RFC1766].
3452
3453   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
3454   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
3455   document are to be interpreted as described in [RFC2119].
3456
34572.  The Language Range
3458
3459   Language tags [RFC4646] are used to help identify languages, whether
3460   spoken, written, signed, or otherwise signaled, for the purpose of
3461   communication.  Applications, protocols, or specifications that use
3462   language tags are often faced with the problem of identifying sets of
3463   content that share certain language attributes.  For example,
3464   HTTP/1.1 [RFC2616] describes one such mechanism in its discussion of
3465   the Accept-Language header (Section 14.4), which is used when
3466   selecting content from servers based on the language of that content.
3467
3468   It is, thus, useful to have a mechanism for identifying sets of
3469   language tags that share specific attributes.  This allows users to
3470   select or filter the language tags based on specific requirements.
3471   Such an identifier is called a "language range".
3472
3473
3474
3475
3476
3477Phillips & Davis         Best Current Practice                  [Page 3]
3478
3479RFC 4647               Matching of Language Tags          September 2006
3480
3481
3482   There are different types of language range, whose specific
3483   attributes vary according to their application.  Language ranges are
3484   similar to language tags: they consist of a sequence of subtags
3485   separated by hyphens.  In a language range, each subtag MUST either
3486   be a sequence of ASCII alphanumeric characters or the single
3487   character '*' (%x2A, ASTERISK).  The character '*' is a "wildcard"
3488   that matches any sequence of subtags.  The meaning and uses of
3489   wildcards vary according to the type of language range.
3490
3491   Language tags and thus language ranges are to be treated as case-
3492   insensitive: there exist conventions for the capitalization of some
3493   of the subtags, but these MUST NOT be taken to carry meaning.
3494   Matching of language tags to language ranges MUST be done in a case-
3495   insensitive manner.
3496
34972.1.  Basic Language Range
3498
3499   A "basic language range" has the same syntax as an [RFC3066] language
3500   tag or is the single character "*".  The basic language range was
3501   originally described by HTTP/1.1 [RFC2616] and later [RFC3066].  It
3502   is defined by the following ABNF [RFC4234]:
3503
3504   language-range   = (1*8ALPHA *("-" 1*8alphanum)) / "*"
3505   alphanum         = ALPHA / DIGIT
3506
3507   A basic language range differs from the language tags defined in
3508   [RFC4646] only in that there is no requirement that it be "well-
3509   formed" or be validated against the IANA Language Subtag Registry.
3510   Such ill-formed ranges will probably not match anything.  Note that
3511   the ABNF [RFC4234] in [RFC2616] is incorrect, since it disallows the
3512   use of digits anywhere in the 'language-range' (see [RFC2616errata]).
3513
35142.2.  Extended Language Range
3515
3516   Occasionally, users will wish to select a set of language tags based
3517   on the presence of specific subtags.  An "extended language range"
3518   describes a user's language preference as an ordered sequence of
3519   subtags.  For example, a user might wish to select all language tags
3520   that contain the region subtag 'CH' (Switzerland).  Extended language
3521   ranges are useful for specifying a particular sequence of subtags
3522   that appear in the set of matching tags without having to specify all
3523   of the intervening subtags.
3524
3525   An extended language range can be represented by the following ABNF:
3526
3527   extended-language-range = (1*8ALPHA / "*")
3528                             *("-" (1*8alphanum / "*"))
3529
3530
3531
3532
3533Phillips & Davis         Best Current Practice                  [Page 4]
3534
3535RFC 4647               Matching of Language Tags          September 2006
3536
3537
3538   The wildcard subtag '*' can occur in any position in the extended
3539   language range, where it matches any sequence of subtags that might
3540   occur in that position in a language tag.  However, wildcards outside
3541   the first position are ignored by Extended Filtering (see Section
3542   3.2.2).  The use or absence of one or more wildcards cannot be taken
3543   to imply that a certain number of subtags will appear in the matching
3544   set of language tags.
3545
35462.3.  The Language Priority List
3547
3548   A user's language preferences will often need to specify more than
3549   one language range, and thus users often need to specify a
3550   prioritized list of language ranges in order to best reflect their
3551   language preferences.  This is especially true for speakers of
3552   minority languages.  A speaker of Breton in France, for example, can
3553   specify "br" followed by "fr", meaning that if Breton is available,
3554   it is preferred, but otherwise French is the best alternative.  It
3555   can get more complex: a different user might want to fall back from
3556   Skolt Sami to Northern Sami to Finnish.
3557
3558   A "language priority list" is a prioritized or weighted list of
3559   language ranges.  One well-known example of such a list is the
3560   "Accept-Language" header defined in RFC 2616 [RFC2616] (see Section
3561   14.4) and RFC 3282 [RFC3282].
3562
3563   The various matching operations described in this document include
3564   considerations for using a language priority list.  This document
3565   does not define the syntax for a language priority list; defining
3566   such a syntax is the responsibility of the protocol, application, or
3567   specification that uses it.  When given as examples in this document,
3568   language priority lists will be shown as a quoted sequence of ranges
3569   separated by commas, like this: "en, fr, zh-Hant" (which is read
3570   "English before French before Chinese as written in the Traditional
3571   script").
3572
3573   A simple list of ranges is considered to be in descending order of
3574   priority.  Other language priority lists provide "quality weights"
3575   for the language ranges in order to specify the relative priority of
3576   the user's language preferences.  An example of this is the use of
3577   "q" values in the syntax of the "Accept-Language" header (defined in
3578   [RFC2616], Section 14.4, and [RFC3282]).
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589Phillips & Davis         Best Current Practice                  [Page 5]
3590
3591RFC 4647               Matching of Language Tags          September 2006
3592
3593
35943.  Types of Matching
3595
3596   Matching language ranges to language tags can be done in many
3597   different ways.  This section describes three such matching schemes,
3598   as well as the considerations for choosing between them.  Protocols
3599   and specifications requiring conformance to this specification MUST
3600   clearly indicate the particular mechanism used in selecting or
3601   matching language tags.
3602
3603   There are two types of matching scheme in this document.  A matching
3604   scheme that produces zero or more matching language tags is called
3605   "filtering".  A matching scheme that produces exactly one match for a
3606   given request is called "lookup".
3607
36083.1.  Choosing a Matching Scheme
3609
3610   Applications, protocols, and specifications are faced with the
3611   decision of what type of matching to use.  Sometimes, different
3612   styles of matching are suited to different kinds of processing within
3613   a particular application or protocol.
3614
3615   This document describes three matching schemes:
3616
3617   1.  Basic Filtering (Section 3.3.1) matches a language priority list
3618       consisting of basic language ranges (Section 2.1) to sets of
3619       language tags.
3620
3621   2.  Extended Filtering (Section 3.3.2) matches a language priority
3622       list consisting of extended language ranges (Section 2.2) to sets
3623       of language tags.
3624
3625   3.  Lookup (Section 3.4) matches a language priority list consisting
3626       of basic language ranges to sets of language tags to find the one
3627       exact language tag that best matches the range.
3628
3629   Filtering can be used to produce a set of results (such as a
3630   collection of documents) by comparing the user's preferences to a set
3631   of language tags.  For example, when performing a search, filtering
3632   can be used to limit the results to items tagged as being in the
3633   French language.  Filtering can also be used when deciding whether to
3634   perform a language-sensitive process on some content.  For example, a
3635   process might cause paragraphs whose language tag matched the
3636   language range "nl" (Dutch) to be displayed in italics within a
3637   document.
3638
3639   Lookup produces the single result that best matches the user's
3640   preferences from the list of available tags, so it is useful in cases
3641   in which a single item is required (and for which only a single item
3642
3643
3644
3645Phillips & Davis         Best Current Practice                  [Page 6]
3646
3647RFC 4647               Matching of Language Tags          September 2006
3648
3649
3650   can be returned).  For example, if a process were to insert a human-
3651   readable error message into a protocol header, it might select the
3652   text based on the user's language priority list.  Since the process
3653   can return only one item, it is forced to choose a single item and it
3654   has to return some item, even if none of the content's language tags
3655   match the language priority list supplied by the user.
3656
36573.2.  Implementation Considerations
3658
3659   Language tag matching is a tool, and does not by itself specify a
3660   complete procedure for the use of language tags.  Such procedures are
3661   intimately tied to the application protocol in which they occur.
3662   When specifying a protocol operation using matching, the protocol
3663   MUST specify:
3664
3665   o  Which type(s) of language tag matching it uses
3666
3667   o  Whether the operation returns a single result (lookup) or a
3668      possibly empty set of results (filtering)
3669
3670   o  For lookup, what the default item is (or the sequence of
3671      operations or configuration information used to determine the
3672      default) when no matching tag is found.  For instance, a protocol
3673      might define the result as failure of the operation, an empty
3674      value, returning some protocol defined or implementation defined
3675      default, or returning i-default [RFC2277].
3676
3677   Applications, protocols, and specifications are not required to
3678   validate or understand any of the semantics of the language tags or
3679   ranges or of the subtags in them, nor do they require access to the
3680   IANA Language Subtag Registry (see Section 3 in [RFC4646]).  This
3681   simplifies implementation.
3682
3683   However, designers of applications, protocols, or specifications are
3684   encouraged to use the information from the IANA Language Subtag
3685   Registry to support canonicalizing language tags and ranges in order
3686   to map grandfathered and obsolete tags or subtags into modern
3687   equivalents.
3688
3689   Applications, protocols, or specifications that canonicalize ranges
3690   MUST either perform matching operations with both the canonical and
3691   original (unmodified) form of the range or MUST also canonicalize
3692   each tag for the purposes of comparison.
3693
3694
3695
3696
3697
3698
3699
3700
3701Phillips & Davis         Best Current Practice                  [Page 7]
3702
3703RFC 4647               Matching of Language Tags          September 2006
3704
3705
3706   Note that canonicalizing language ranges makes certain operations
3707   impossible.  For example, an implementation that canonicalizes the
3708   language range "art-lojban" (artificial language, lojban variant) to
3709   use the more modern "jbo" (Lojban) cannot be used to select just the
3710   items with the older tag.
3711
3712   Applications, protocols, or specifications that use basic ranges
3713   might sometimes receive extended language ranges instead.  An
3714   application, protocol, or specification MUST choose to a) map
3715   extended language ranges to basic ranges using the algorithm below,
3716   b) reject any extended language ranges in the language priority list
3717   that are not valid basic language ranges, or c) treat each extended
3718   language range as if it were a basic language range, which will have
3719   the same result as ignoring them, since these ranges will not match
3720   any valid language tags.
3721
3722   An extended language range is mapped to a basic language range as
3723   follows: if the first subtag is a '*' then the entire range is
3724   treated as "*", otherwise each wildcard subtag is removed.  For
3725   example, the extended language range "en-*-US" maps to "en-US"
3726   (English, United States).
3727
3728   Applications, protocols, or specifications, in addressing their
3729   particular requirements, can offer pre-processing or configuration
3730   options.  For example, an implementation could allow a user to
3731   associate or map a particular language range to a different value.
3732   Such a user might wish to associate the language range subtags 'nn'
3733   (Nynorsk Norwegian) and 'nb' (Bokmal Norwegian) with the more general
3734   subtag 'no' (Norwegian).  Or perhaps a user would want to associate
3735   requests for the range "zh-Hans" (Chinese as written in the
3736   Simplified script) with content bearing the language tag "zh-CN"
3737   (Chinese as used in China, where the Simplified script is
3738   predominant).  Documentation on how the ranges or tags are altered,
3739   prioritized, or compared in the subsequent match in such an
3740   implementation will assist users in making these types of
3741   configuration choices.
3742
37433.3.  Filtering
3744
3745   Filtering is used to select the set of language tags that matches a
3746   given language priority list.  It is called "filtering" because this
3747   set might contain no items at all or it might return an arbitrarily
3748   large number of matching items: as many items as match the language
3749   priority list, thus "filtering out" the non-matching items.
3750
3751   In filtering, each language range represents the least specific
3752   language tag (that is, the language tag with fewest number of
3753   subtags) that is an acceptable match.  All of the language tags in
3754
3755
3756
3757Phillips & Davis         Best Current Practice                  [Page 8]
3758
3759RFC 4647               Matching of Language Tags          September 2006
3760
3761
3762   the matching set of tags will have an equal or greater number of
3763   subtags than the language range.  Every non-wildcard subtag in the
3764   language range will appear in every one of the matching language
3765   tags.  For example, if the language priority list consists of the
3766   range "de-CH" (German as used in Switzerland), one might see tags
3767   such as "de-CH-1996" (German as used in Switzerland, orthography of
3768   1996) but one will never see a tag such as "de" (because the 'CH'
3769   subtag is missing).
3770
3771   If the language priority list (see Section 2.3) contains more than
3772   one range, the content returned is typically ordered in descending
3773   level of preference, but it MAY be unordered, according to the needs
3774   of the application or protocol.
3775
3776   Some examples of applications where filtering might be appropriate
3777   include:
3778
3779   o  Applying a style to sections of a document in a particular set of
3780      languages.
3781
3782   o  Displaying the set of documents containing a particular set of
3783      keywords written in a specific set of languages.
3784
3785   o  Selecting all email items written in a specific set of languages.
3786
3787   o  Selecting audio files spoken in a particular language.
3788
3789   Filtering seems to imply that there is a semantic relationship
3790   between language tags that share the same prefix.  While this is
3791   often the case, it is not always true: the language tags that match a
3792   specific language range do not necessarily represent mutually
3793   intelligible languages.
3794
37953.3.1.  Basic Filtering
3796
3797   Basic filtering compares basic language ranges to language tags.
3798   Each basic language range in the language priority list is considered
3799   in turn, according to priority.  A language range matches a
3800   particular language tag if, in a case-insensitive comparison, it
3801   exactly equals the tag, or if it exactly equals a prefix of the tag
3802   such that the first character following the prefix is "-".  For
3803   example, the language-range "de-de" (German as used in Germany)
3804   matches the language tag "de-DE-1996" (German as used in Germany,
3805   orthography of 1996), but not the language tags "de-Deva" (German as
3806   written in the Devanagari script) or "de-Latn-DE" (German, Latin
3807   script, as used in Germany).
3808
3809
3810
3811
3812
3813Phillips & Davis         Best Current Practice                  [Page 9]
3814
3815RFC 4647               Matching of Language Tags          September 2006
3816
3817
3818   The special range "*" in a language priority list matches any tag.  A
3819   protocol that uses language ranges MAY specify additional rules about
3820   the semantics of "*"; for instance, HTTP/1.1 [RFC2616] specifies that
3821   the range "*" matches only languages not matched by any other range
3822   within an "Accept-Language" header.
3823
3824   Basic filtering is identical to the type of matching described in
3825   [RFC3066], Section 2.5 (Language-range).
3826
38273.3.2.  Extended Filtering
3828
3829   Extended filtering compares extended language ranges to language
3830   tags.  Each extended language range in the language priority list is
3831   considered in turn, according to priority.  A language range matches
3832   a particular language tag if each respective list of subtags matches.
3833   To determine a match:
3834
3835   1.  Split both the extended language range and the language tag being
3836       compared into a list of subtags by dividing on the hyphen (%x2D)
3837       character.  Two subtags match if either they are the same when
3838       compared case-insensitively or the language range's subtag is the
3839       wildcard '*'.
3840
3841   2.  Begin with the first subtag in each list.  If the first subtag in
3842       the range does not match the first subtag in the tag, the overall
3843       match fails.  Otherwise, move to the next subtag in both the
3844       range and the tag.
3845
3846   3.  While there are more subtags left in the language range's list:
3847
3848       A.  If the subtag currently being examined in the range is the
3849           wildcard ('*'), move to the next subtag in the range and
3850           continue with the loop.
3851
3852       B.  Else, if there are no more subtags in the language tag's
3853           list, the match fails.
3854
3855       C.  Else, if the current subtag in the range's list matches the
3856           current subtag in the language tag's list, move to the next
3857           subtag in both lists and continue with the loop.
3858
3859       D.  Else, if the language tag's subtag is a "singleton" (a single
3860           letter or digit, which includes the private-use subtag 'x')
3861           the match fails.
3862
3863       E.  Else, move to the next subtag in the language tag's list and
3864           continue with the loop.
3865
3866
3867
3868
3869Phillips & Davis         Best Current Practice                 [Page 10]
3870
3871RFC 4647               Matching of Language Tags          September 2006
3872
3873
3874   4.  When the language range's list has no more subtags, the match
3875       succeeds.
3876
3877   Subtags not specified, including those at the end of the language
3878   range, are thus treated as if assigned the wildcard value '*'.  Much
3879   like basic filtering, extended filtering selects content with
3880   arbitrarily long tags that share the same initial subtags as the
3881   language range.  In addition, extended filtering selects language
3882   tags that contain any intermediate subtags not specified in the
3883   language range.  For example, the extended language range "de-*-DE"
3884   (or its synonym "de-DE") matches all of the following tags:
3885
3886      de-DE (German, as used in Germany)
3887
3888      de-de (German, as used in Germany)
3889
3890      de-Latn-DE (Latin script)
3891
3892      de-Latf-DE (Fraktur variant of Latin script)
3893
3894      de-DE-x-goethe (private-use subtag)
3895
3896      de-Latn-DE-1996 (orthography of 1996)
3897
3898      de-Deva-DE (Devanagari script)
3899
3900   The same range does not match any of the following tags for the
3901   reasons shown:
3902
3903      de (missing 'DE')
3904
3905      de-x-DE (singleton 'x' occurs before 'DE')
3906
3907      de-Deva ('Deva' not equal to 'DE')
3908
3909   Note: [RFC4646] defines each type of subtag (language, script,
3910   region, and so forth) according to position, size, and content.  This
3911   means that subtags in a language range can only match specific types
3912   of subtags in a language tag.  For example, a subtag such as 'Latn'
3913   is always a script subtag (unless it follows a singleton) while a
3914   subtag such as 'nedis' can only match the equivalent variant subtag.
3915   Two-letter subtags in the initial position have a different type
3916   (language) than two-letter subtags in later positions (region).  This
3917   is the reason why a wildcard in the extended language range is
3918   significant in the first position but is ignored in all other
3919   positions.
3920
3921
3922
3923
3924
3925Phillips & Davis         Best Current Practice                 [Page 11]
3926
3927RFC 4647               Matching of Language Tags          September 2006
3928
3929
39303.4.  Lookup
3931
3932   Lookup is used to select the single language tag that best matches
3933   the language priority list for a given request.  When performing
3934   lookup, each language range in the language priority list is
3935   considered in turn, according to priority.  By contrast with
3936   filtering, each language range represents the most specific tag that
3937   is an acceptable match.  The first matching tag found, according to
3938   the user's priority, is considered the closest match and is the item
3939   returned.  For example, if the language range is "de-ch", a lookup
3940   operation can produce content with the tags "de" or "de-CH" but never
3941   content with the tag "de-CH-1996".  If no language tag matches the
3942   request, the "default" value is returned.
3943
3944   For example, if an application inserts some dynamic content into a
3945   document, returning an empty string if there is no exact match is not
3946   an option.  Instead, the application "falls back" until it finds a
3947   matching language tag associated with a suitable piece of content to
3948   insert.  Some applications of lookup include:
3949
3950   o  Selection of a template containing the text for an automated email
3951      response.
3952
3953   o  Selection of an item containing some text for inclusion in a
3954      particular Web page.
3955
3956   o  Selection of a string of text for inclusion in an error log.
3957
3958   o  Selection of an audio file to play as a prompt in a phone system.
3959
3960   In the lookup scheme, the language range is progressively truncated
3961   from the end until a matching language tag is located.  Single letter
3962   or digit subtags (including both the letter 'x', which introduces
3963   private-use sequences, and the subtags that introduce extensions) are
3964   removed at the same time as their closest trailing subtag.  For
3965   example, starting with the range "zh-Hant-CN-x-private1-private2"
3966   (Chinese, Traditional script, China, two private-use tags) the lookup
3967   progressively searches for content as shown below:
3968
3969   Example of a Lookup Fallback Pattern
3970
3971   Range to match: zh-Hant-CN-x-private1-private2
3972   1. zh-Hant-CN-x-private1-private2
3973   2. zh-Hant-CN-x-private1
3974   3. zh-Hant-CN
3975   4. zh-Hant
3976   5. zh
3977   6. (default)
3978
3979
3980
3981Phillips & Davis         Best Current Practice                 [Page 12]
3982
3983RFC 4647               Matching of Language Tags          September 2006
3984
3985
3986   This fallback behavior allows some flexibility in finding a match.
3987   Without fallback, the default content would be returned immediately
3988   if exactly matching content is unavailable.  With fallback, a result
3989   more closely matching the user request can be provided.
3990
3991   Extensions and unrecognized private-use subtags might be unrelated to
3992   a particular application of lookup.  Since these subtags come at the
3993   end of the subtag sequence, they are removed first during the
3994   fallback process and usually pose no barrier to interoperability.
3995   However, an implementation MAY remove these from ranges prior to
3996   performing the lookup (provided the implementation also removes them
3997   from the tags being compared).  Such modification is internal to the
3998   implementation and applications, protocols, or specifications SHOULD
3999   NOT remove or modify subtags in content that they return or forward,
4000   because this removes information that can be used elsewhere.
4001
4002   The special language range "*" matches any language tag.  In the
4003   lookup scheme, this range does not convey enough information by
4004   itself to determine which language tag is most appropriate, since it
4005   matches everything.  If the language range "*" is followed by other
4006   language ranges, it is skipped.  If the language range "*" is the
4007   only one in the language priority list or if no other language range
4008   follows, the default value is computed and returned.
4009
4010   In some cases, the language priority list can contain one or more
4011   extended language ranges (as, for example, when the same language
4012   priority list is used as input for both lookup and filtering
4013   operations).  Wildcard values in an extended language range normally
4014   match any value that can occur in that position in a language tag.
4015   Since only one item can be returned for any given lookup request,
4016   wildcards in a language range have to be processed in a consistent
4017   manner or the same request will produce widely varying results.
4018   Applications, protocols, or specifications that accept extended
4019   language ranges MUST define which item is returned when more than one
4020   item matches the extended language range.
4021
4022   For example, an implementation could map the extended language ranges
4023   to basic ranges.  Another possibility would be for an implementation
4024   to return the matching tag that is first in ASCII-order.  If the
4025   language range were "*-CH" ('CH' represents Switzerland) and the set
4026   of tags included "de-CH" (German as used in Switzerland), "fr-CH"
4027   (French, Switzerland), and "it-CH" (Italian, Switzerland), then the
4028   tag "de-CH" would be returned.
4029
4030
4031
4032
4033
4034
4035
4036
4037Phillips & Davis         Best Current Practice                 [Page 13]
4038
4039RFC 4647               Matching of Language Tags          September 2006
4040
4041
40423.4.1.  Default Values
4043
4044   Each application, protocol, or specification that uses lookup MUST
4045   define the defaulting behavior when no tag matches the language
4046   priority list.  What this action consists of strongly depends on how
4047   lookup is being applied.  Some examples of defaulting behavior
4048   include:
4049
4050   o  return an item with no language tag or an item of a non-linguistic
4051      nature, such as an image or sound
4052
4053   o  return a null string as the language tag value, in cases where the
4054      protocol permits the empty value (see, for example, "xml:lang" in
4055      [XML10])
4056
4057   o  return a particular language tag designated for the operation
4058
4059   o  return the language tag "i-default" (see [RFC2277])
4060
4061   o  return an error condition or error message
4062
4063   o  return a list of available languages for the user to select from
4064
4065   When performing lookup using a language priority list, the
4066   progressive search MUST process each language range in the list
4067   before seeking or calculating the default.
4068
4069   The default value MAY be calculated or include additional searching
4070   or matching.  Applications, protocols, or specifications can specify
4071   different ways in which users can specify or override the defaults.
4072
4073   One common way to provide for a default is to allow a specific
4074   language range to be set as the default for a specific type of
4075   request.  If this approach is chosen, this language range MUST be
4076   treated as if it were appended to the end of the language priority
4077   list as a whole, rather than after each item in the language priority
4078   list.  The application, protocol, or specification MUST also define
4079   the defaulting behavior if that search fails to find a matching tag
4080   or item.
4081
4082   For example, if a particular user's language priority list is "fr-FR,
4083   zh-Hant" (French as used in France followed by Chinese as written in
4084   the Traditional script) and the program doing the matching had a
4085   default language range of "ja-JP" (Japanese as used in Japan), then
4086   the program searches as follows:
4087
4088
4089
4090
4091
4092
4093Phillips & Davis         Best Current Practice                 [Page 14]
4094
4095RFC 4647               Matching of Language Tags          September 2006
4096
4097
4098   1. fr-FR
4099   2. fr
4100   3. zh-Hant // next language
4101   4. zh
4102   5. ja-JP   // now searching for the default content
4103   6. ja
4104   7. (implementation defined default)
4105
41064.  Other Considerations
4107
4108   When working with language ranges and matching schemes, there are
4109   some additional points that can influence the choice of either.
4110
41114.1.  Choosing Language Ranges
4112
4113   Users indicate their language preferences via the choice of a
4114   language range or the list of language ranges in a language priority
4115   list.  The type of matching affects what the best choice is for a
4116   user.
4117
4118   Most matching schemes make no attempt to process the semantic meaning
4119   of the subtags.  The language range is compared, in a case-
4120   insensitive manner, to each language tag being matched, using basic
4121   string processing.  Users SHOULD select language ranges that are
4122   well-formed, valid language tags according to [RFC4646] (substituting
4123   wildcards as appropriate in extended language ranges).
4124
4125   Applications are encouraged to canonicalize language tags and ranges
4126   by using the Preferred-Value from the IANA Language Subtag Registry
4127   for tags or subtags that have been deprecated.  If the user is
4128   working with content that might use the older form, the user might
4129   want to include both the new and old forms in a language priority
4130   list.  For example, the tag "art-lojban" is deprecated.  The subtag
4131   'jbo' is supposed to be used instead, so the user might use it to
4132   form the language range.  Or the user might include both in a
4133   language priority list: "jbo, art-lojban".
4134
4135   Users SHOULD avoid subtags that add no distinguishing value to a
4136   language range.  When filtering, the fewer the number of subtags that
4137   appear in the language range, the more content the range will
4138   probably match, while in lookup unnecessary subtags can cause
4139   "better", more-specific content to be skipped in favor of less
4140   specific content.  For example, the range "de-Latn-DE" returns
4141   content tagged "de" instead of content tagged "de-DE", even though
4142   the latter is probably a better match.
4143
4144
4145
4146
4147
4148
4149Phillips & Davis         Best Current Practice                 [Page 15]
4150
4151RFC 4647               Matching of Language Tags          September 2006
4152
4153
4154   Whether a subtag adds distinguishing value can depend on the context
4155   of the request.  For example, a user who reads both Simplified and
4156   Traditional Chinese, but who prefers Simplified, might use the range
4157   "zh" for filtering (matching all items that user can read) but
4158   "zh-Hans" for lookup (making sure that user gets the preferred form
4159   if it's available, but the fallback to "zh" will still work).  On the
4160   other hand, content in this case ought to be labeled as "zh-Hans" (or
4161   "zh-Hant" if that applies) for filtering, while for lookup, if there
4162   is either "zh-Hans" content or "zh-Hant" content, one of them (the
4163   one considered 'default') also ought to be made available with the
4164   simple "zh".  Note that the user can create a language priority list
4165   "zh-Hans, zh" that delivers the best possible results for both
4166   schemes.  If the user cannot be sure which scheme is being used (or
4167   if more than one might be applied to a given request), the user
4168   SHOULD specify the most specific (largest number of subtags) range
4169   first and then supply shorter prefixes later in the list to ensure
4170   that filtering returns a complete set of tags.
4171
4172   Many languages are written predominantly in a single script.  This is
4173   usually recorded in the Suppress-Script field in that language
4174   subtag's registry entry.  For these languages, script subtags SHOULD
4175   NOT be used to form a language range.  Thus, the language range
4176   "en-Latn" is inappropriate in most cases (because the vast majority
4177   of English documents are written in the Latin script and thus the
4178   'en' language subtag has a Suppress-Script field for 'Latn' in the
4179   registry).
4180
4181   When working with tags and ranges, note that extensions and most
4182   private-use subtags are orthogonal to language tag matching, in that
4183   they specify additional attributes of the text not related to the
4184   goals of most matching schemes.  Users SHOULD avoid using these
4185   subtags in language ranges, since they interfere with the selection
4186   of available content.  When used in language tags (as opposed to
4187   ranges), these subtags normally do not interfere with filtering
4188   (Section 3), since they appear at the end of the tag and will match
4189   all prefixes.  Lookup (Section 3.4) implementations are advised to
4190   ignore unrecognized private-use and extension subtags when performing
4191   language tag fallback.
4192
41934.2.  Meaning of Language Tags and Ranges
4194
4195   Selecting language tags using language ranges requires some
4196   understanding by users of what they are selecting.  The meanings of
4197   the various subtags in a language range are identical to their
4198   meanings in a language tag (see Section 4.2 in [RFC4646]), with the
4199   addition that the wildcard "*" represents any matching sequence of
4200   values.
4201
4202
4203
4204
4205Phillips & Davis         Best Current Practice                 [Page 16]
4206
4207RFC 4647               Matching of Language Tags          September 2006
4208
4209
42104.3.  Considerations for Private-Use Subtags
4211
4212   Private agreement is necessary between the parties that intend to use
4213   or exchange language tags that contain private-use subtags.  Great
4214   caution SHOULD be used in employing private-use subtags in content or
4215   protocols intended for general use.  Private-use subtags are simply
4216   useless for information exchange without prior arrangement.
4217
4218   The value and semantic meaning of private-use tags and of the subtags
4219   used within such a language tag are not defined.  Matching private-
4220   use tags using language ranges or extended language ranges can result
4221   in unpredictable content being returned.
4222
42234.4.  Length Considerations for Language Ranges
4224
4225   Language ranges are very similar to language tags in terms of content
4226   and usage.  The same types of restrictions on length that can be
4227   applied to language tags can also be applied to language ranges.  See
4228   [RFC4646] Section 4.3 (Length Considerations).
4229
42305.  Security Considerations
4231
4232   Language ranges used in content negotiation might be used to infer
4233   the nationality of the sender, and thus identify potential targets
4234   for surveillance.  In addition, unique or highly unusual language
4235   ranges or combinations of language ranges might be used to track a
4236   specific individual's activities.
4237
4238   This is a special case of the general problem that anything you send
4239   is visible to the receiving party.  It is useful to be aware that
4240   such concerns can exist in some cases.
4241
4242   The evaluation of the exact magnitude of the threat, and any possible
4243   countermeasures, is left to each application or protocol.
4244
42456.  Character Set Considerations
4246
4247   Language tags permit only the characters A-Z, a-z, 0-9, and HYPHEN-
4248   MINUS (%x2D).  Language ranges also use the character ASTERISK
4249   (%x2A).  These characters are present in most character sets, so
4250   presentation or exchange of language tags or ranges should not be
4251   constrained by character set issues.
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261Phillips & Davis         Best Current Practice                 [Page 17]
4262
4263RFC 4647               Matching of Language Tags          September 2006
4264
4265
42667.  References
4267
42687.1.  Normative References
4269
4270   [RFC2119]       Bradner, S., "Key words for use in RFCs to Indicate
4271                   Requirement Levels", BCP 14, RFC 2119, March 1997.
4272
4273   [RFC2277]       Alvestrand, H., "IETF Policy on Character Sets and
4274                   Languages", BCP 18, RFC 2277, January 1998.
4275
4276   [RFC4234]       Crocker, D., Ed. and P. Overell, "Augmented BNF for
4277                   Syntax Specifications: ABNF", RFC 4234, October 2005.
4278
4279   [RFC4646]       Phillips, A., Ed., and M. Davis, Ed., "Tags for
4280                   Identifying Languages", BCP 47, RFC 4646, September
4281                   2006.
4282
42837.2.  Informative References
4284
4285   [RFC1766]       Alvestrand, H., "Tags for the Identification of
4286                   Languages", RFC 1766, March 1995.
4287
4288   [RFC2616]       Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
4289                   Masinter, L., Leach, P., and T. Berners-Lee,
4290                   "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616,
4291                   June 1999.
4292
4293   [RFC2616errata] IETF, "HTTP/1.1 Specification Errata", October 2004,
4294                   <http://purl.org/NET/http-errata>.
4295
4296   [RFC3066]       Alvestrand, H., "Tags for the Identification of
4297                   Languages", BCP 47, RFC 3066, January 2001.
4298
4299   [RFC3282]       Alvestrand, H., "Content Language Headers", RFC 3282,
4300                   May 2002.
4301
4302   [XML10]         Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E.,
4303                   and F. Yergeau, "Extensible Markup Language (XML) 1.0
4304                   (Third Edition)", World Wide Web Consortium
4305                   Recommendation, February 2004,
4306                   <http://www.w3.org/TR/REC-xml>.
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317Phillips & Davis         Best Current Practice                 [Page 18]
4318
4319RFC 4647               Matching of Language Tags          September 2006
4320
4321
4322Appendix A.  Acknowledgements
4323
4324   Any list of contributors is bound to be incomplete; please regard the
4325   following as only a selection from the group of people who have
4326   contributed to make this document what it is today.
4327
4328   The contributors to [RFC1766] and [RFC3066], each of which was a
4329   precursor to this document, contributed greatly to the development of
4330   language tag matching, and, in particular, the basic language range
4331   and the basic matching scheme.  This document was originally part of
4332   [RFC4646], but was split off before that document's completion.
4333   Thus, directly or indirectly, those acknowledged in [RFC4646] also
4334   had a hand in the development of this document, and work done prior
4335   to the split is acknowledged in that document.
4336
4337   The following people (in alphabetical order by family name)
4338   contributed to this document:
4339
4340   Harald Alvestrand, Stephane Bortzmeyer, Jeremy Carroll, Peter
4341   Constable, John Cowan, Mark Crispin, Martin Duerst, Frank Ellermann,
4342   Doug Ewell, Debbie Garside, Marion Gunn, Jon Hanna, Kent Karlsson,
4343   Erkki Kolehmainen, Jukka Korpela, Ira McDonald, M. Patton, Randy
4344   Presuhn, Eric van der Poel, Markus Scherer, Misha Wolf, and many,
4345   many others.
4346
4347   Very special thanks must go to Harald Tveit Alvestrand, who
4348   originated RFCs 1766 and 3066, and without whom this document would
4349   not have been possible.
4350
4351Authors' Addresses
4352
4353   Addison Phillips (Editor)
4354   Yahoo! Inc.
4355
4356   EMail: addison@inter-locale.com
4357
4358
4359   Mark Davis (Editor)
4360   Google
4361
4362   EMail: mark.davis@macchiato.com or mark.davis@google.com
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373Phillips & Davis         Best Current Practice                 [Page 19]
4374
4375RFC 4647               Matching of Language Tags          September 2006
4376
4377
4378Full Copyright Statement
4379
4380   Copyright (C) The Internet Society (2006).
4381
4382   This document is subject to the rights, licenses and restrictions
4383   contained in BCP 78, and except as set forth therein, the authors
4384   retain all their rights.
4385
4386   This document and the information contained herein are provided on an
4387   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
4388   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
4389   ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
4390   INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
4391   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
4392   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
4393
4394Intellectual Property
4395
4396   The IETF takes no position regarding the validity or scope of any
4397   Intellectual Property Rights or other rights that might be claimed to
4398   pertain to the implementation or use of the technology described in
4399   this document or the extent to which any license under such rights
4400   might or might not be available; nor does it represent that it has
4401   made any independent effort to identify any such rights.  Information
4402   on the procedures with respect to rights in RFC documents can be
4403   found in BCP 78 and BCP 79.
4404
4405   Copies of IPR disclosures made to the IETF Secretariat and any
4406   assurances of licenses to be made available, or the result of an
4407   attempt made to obtain a general license or permission for the use of
4408   such proprietary rights by implementers or users of this
4409   specification can be obtained from the IETF on-line IPR repository at
4410   http://www.ietf.org/ipr.
4411
4412   The IETF invites any interested party to bring to its attention any
4413   copyrights, patents or patent applications, or other proprietary
4414   rights that may cover technology that may be required to implement
4415   this standard.  Please address the information to the IETF at
4416   ietf-ipr@ietf.org.
4417
4418Acknowledgement
4419
4420   Funding for the RFC Editor function is provided by the IETF
4421   Administrative Support Activity (IASA).
4422
4423
4424
4425
4426
4427
4428
4429Phillips & Davis         Best Current Practice                 [Page 20]
4430
4431