Skip to content

Main content

BCP 47 Extlang Subtag Boundary Tool

Compute bcp 47 extlang subtag boundary from explicit bounded inputs.

Loading tool…

Description

Split a language-tag-shaped string into language, up to three extlang-shaped parts, and a remainder.

Identifier validation can involve several distinct questions: whether text has the expected shape, whether a checksum is consistent, and whether an authority actually assigned the identifier. Formatting and field extraction address narrower questions. Each result must be read according to the particular property the tool checks.

Split a language-tag-shaped string into language, up to three extlang-shaped parts, and a remainder.

When to use this tool

Use BCP 47 Extlang Subtag Boundary when you need the particular shape, formatting, field, or checksum property as one explicit stage in an identifier workflow.

How to use the tool and how it works

  1. Enter tag. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read language, extlangs, remainder. Use the output convention below.

Require a two- or three-letter first part and later alphanumeric parts from one through eight characters. Consume up to three following three-letter parts as extlangs, then return language, extlangs, and remainder.1

Input fieldMeaning and unitsAccepted input
tagTagRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
languageLanguageRequired. Text; maximum UTF-16 length 8192.
extlangsExtlangsRequired. Array of Text; maximum UTF-16 length 8192.; maximum items 256.
remainderRemainderRequired. Array of Text; maximum UTF-16 length 8192.; maximum items 256.
json
{
  "input": {
    "tag": "zh-cmn-Hans-CN"
  },
  "output": {
    "language": "zh",
    "extlangs": [
      "cmn"
    ],
    "remainder": [
      "Hans",
      "CN"
    ]
  }
}

Limitations and assumptions

  • This is a structural split without registry, preferred-value, permitted-prefix, or complete language-tag checks. Tokens resembling an extlang are classified by spelling rather than verified assignment.
  • The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.

Alternative or Complementary methods

Use a complete format and checksum validator when required, then consult the issuing registry or verification process for assignment and identity. Preserve meaningful leading zeros as text.

References

  1. Calculation and input contract: validate/bcp47-extlang-subtag-boundary — tool.io

Similar or alternative tools