Applies to: Protocol and format interpretation for developers inspecting authorized media delivery.
The useful distinctions
- LanguageBCP47 carries a BCP 47 language tag.
- When present, LanguageBCP47 takes precedence over the legacy Language element.
- BCP 47 language tags use hyphen-separated subtags and are case-insensitive.
Preserve the evidence before normalizing
The invented track has a legacy English code and a BCP 47 Urdu tag. A useful metadata ledger stores the original values in separate columns, then records the effective language according to the format's precedence rule. Overwriting the legacy field would conceal the inconsistency from a later export review. A track name such as Main is a human label and does not resolve this conflict. The decision follows typed metadata rather than an inference about the words being spoken.
Make the transformation reversible
For a catalogue migration, retain the supplied spelling of the tag alongside any normalized display form. For example, the region subtag PK adds specificity to ur; reducing the whole tag to ur discards information. Uppercase region spelling is a useful convention rather than a different language identity. A validator should separate three questions: whether the element is allowed in the container, whether the tag is syntactically valid, and whether that language accurately describes the content. Only the first two can be assessed from metadata alone. The fictional values deliberately disagree so a test fixture can reveal an importer that silently prefers the older field.
Worked example · synthetic
These EBML child elements encode legacy Language='eng' and LanguageBCP47='ur-PK'. The effective language is Urdu with region PK. They are a valid element sequence for insertion in a TrackEntry, not a complete Matroska file.
Isolated valid TrackEntry children; no enclosing track or encoded samples are supplied.
22 B5 9C 83 65 6E 67 22 B5 9D 85 75 72 2D 50 4B
Check the interpretation
- Decode element sizes before interpreting UTF-8 payloads.
- Retain both original fields in an audit export.
- Check tag syntax separately from the truth of the language description.