function IsPdfUaLanguageTagValid(const Tag: WString): Boolean;
| Tag | WString |
BooleanIsPdfUaLanguageTagValid validates the shape of a language tag as used in catalogue /Lang, structure element /Lang, and marked-content /Lang entries
A tag is a primary subtag of 1 to 8 ASCII letters, followed by zero or more hyphen-separated subtags of 1 to 8 ASCII letters or digits. This is the ^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$ grammar required by ISO 14289-2 8.4.4/2 and ISO 14289-1 7.2/29
Leading hyphens, consecutive hyphens, trailing hyphens, empty tags and overlong subtags such as portugues-pt or nl-1234abcde are invalid
pvuaiStructElementLangInvalid check on non-empty structure element /Lang values, and ResolvePdfUaEffectiveLanguage uses it for DeclarationValidValid := IsPdfUaLanguageTagValid(Pdf.Language);