Skip to content

DataStandardizer.LanguageTag 2.0.1

Choose a tag to compare

@github-actions github-actions released this 23 Nov 08:21
· 1 commit to develop since this release
d23d8d6

Breaking changes:

  • Casting a string to Bcp47KeyedSubtag throws InvalidCastException unless it is one extension or one private use sequence.
  • Loading a SubtagRegistry throws FormatException, naming the record's line, for a Prefix that isn't a well-formed language tag or that repeats a variant subtag or extension singleton, a Suppress-Script that isn't a script subtag, a Macrolanguage that isn't a primary language subtag, a Preferred-Value not in the form RFC 5646 §3.1.2 gives it for the record's Type, an extlang record whose Preferred-Value is missing or not identical to its Subtag, and an empty Suppress-Script, Macrolanguage or Preferred-Value (RFC 5646 §2.2.2, §2.2.9, §3.1.2, §3.1.7 to §3.1.10). Before, such a registry loaded.
  • Bcp47KeyedSubtag.Singleton returns char instead of char?; code that reads .Value or .HasValue, or applies ?? to it, uses the property directly.

Fixed:

  • A reused Bcp47LanguageTagBuilder no longer returns the earlier tag, or mixes the earlier tag's subtags into the new one. UsingLanguageTag and UsingPrimaryLanguageSubtag each start a new tag; the Subtag Registry or conformance chosen stays.
  • Loading a SubtagRegistry throws FormatException, naming the line, for a Prefix field outside an extlang or variant record, an extlang record without exactly one, an empty Prefix or Scope, a Suppress-Script, Macrolanguage or Scope field outside a language or extlang record, a Scope other than macrolanguage, collection, special and private-use, a Subtag that isn't a subtag of its record's Type in the case RFC 5646 §3.1.4 gives it, a Tag not formatted as §2.1.1 describes, or a character outside printable US-ASCII in a field RFC 5646 defines, other than Description and Comments (RFC 5646 §3.1.1, §3.1.2, §3.1.4, §3.1.8). Before, such a registry loaded and its records showed up through Languages, Regions, TryGetSubtag and the other members.
  • Bcp47LanguageTag.Create with LanguageTagConformance.IsoCodeLists reports a repeated variant subtag or extension singleton with its own message, instead of blaming well-formedness or the ISO code lists.
  • The package now includes its XML documentation, so IntelliSense shows member descriptions.
  • Parsing a language tag, and Bcp47LanguageTagBuilder.UsingVariantSubtags, check a long list of variant subtags for repeats faster.