Commit Graph

2 Commits

Author SHA1 Message Date
Moritz Bunkus
88b97761bf
all: chapters: normalize legacy & IETF BCP 47 language/country elements
With this change both legacy language/country elements and IETF BCP 47
language tags will be normalized when chapters are read or
written. This fixes a couple of corner cases in all programs dealing
with chapters:

1. IETF BCP 47 elements will now always be created before writing
   chapters unless IETF BCP 47 elements are disabled. This wasn't
   always the case when chapters were read from Matroska files.

2. When a chapter display element contains legacy language & country
   elements but no IETF BCP 47 elements and IETF BCP 47 elements
   aren't disabled, the IETF BCP 47 elements created will contain the
   region from the legacy element. Before the change the elements
   created didn't contain a country, leading to a change in semantics
   as IETF BCP 47 elements take precedence over all legacy elements
   when they're present.

3. Legacy country elements are now created when IETF BCP 47 elements
   are present & contain a region code allowed in legacy country
   elements.

Part of the fix of #3193.
2021-09-01 22:24:44 +02:00
Moritz Bunkus
640a0ba0a6
tests: convert to four-digit numbers 2021-07-07 16:10:13 +02:00