Visual RFC.
ALL RFCs / RFC 4647
Read the RFC ↗
RFC 4647 / LANGUAGE MATCHING

Exhaust preferences before defaulting

05

A reader can list several language preferences. Lookup exhausts the first range’s shorter attempts, then tries the next range. A default comes after the whole requested list.

RFC 4647 · § 3.4.1EXAMPLE
4 / 4
04
A lone wildcard computes a default

Now request only *. In this example’s lookup policy it reaches the configured ja-JP default. Under filtering, * instead returns both available labels.

Exhaust preferences before defaultingNow request only *. In this example’s lookup policy it reaches the configured ja-JP default. Under filtering, * instead returns both available labels.Separate request*Available: zh-Hant and ja-JP* does not rank languages for lookupcompute defaultja-JPFiltering * would keep both available labels

Key idea: Every requested range MUST be tried before seeking or calculating the default.

Terms
Priority list
Language ranges listed in the reader’s preference order. The using protocol defines its syntax.
Default
The using application’s specified outcome after lookup requests fail.

Look up a term in the glossary ↗

Rules & examples
  • The using application MUST define default behavior. It might return a configured item, an empty value or an error. No language, including English, is the RFC’s universal default.
  • For fr-FR then zh-Hant, try fr-FR and fr before zh-Hant and zh. A configured default range is treated as appended after the entire list, not after each preference.
  • In lookup, * is skipped when another range follows. If * is alone or final, compute the default. It does not choose a universally best language.
  • The same * under filtering matches every available label. The using protocol MUST specify the matching scheme and, for lookup, the default behavior (§3.2).
  • The configured example default is ja-JP. The application still needs a final outcome if that default search fails. This guide does not define HTTP q-value parsing or translation.

The input changes between the two-preference, one-preference and wildcard examples are labeled explicitly. ja-JP is chosen for this application, not an RFC-wide recommendation.

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

Requested languages and available labels

Imagine a catalog of labeled documents. A filter keeps all labels that fit a pattern; a lookup tries preferences and returns one exact label or a defined default. Neither operation translates the document or guarantees understanding.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

All chapters in RFC 4647

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗