Skip to content

TC String Encoding/Decoding Defaults Advanced Language Codes to English (EN) #100

@pavankumarupadhyayula

Description

@pavankumarupadhyayula

Description

There is a critical issue with the @iabtechlabtcf/core library where advanced language codes are not properly preserved during the TC string encoding and decoding process.

Problem Statement

When advanced language codes such as PT-BR (Portuguese - Brazil) or SR-LATN (Serbian - Latin script) are used, the implementation incorrectly defaults to English (EN) instead of preserving the specified language code as required by the IAB TCF specification.

Affected Component

Current Behavior

  1. SR-LATN has been added to the supported language Set in ConsentLanguages.ts
  2. During the encoding process, when advanced language codes like SR-LATN or PT-BR are specified, the implementation defaults to English (EN)
  3. When the TC string is decoded, the language shows as EN instead of the originally specified advanced language code (SR-LATN, PT-BR, etc.)

Expected Behavior

The full language code (e.g., SR-LATN, PT-BR) should be preserved throughout the encoding and decoding process, ensuring that the exact language specification is maintained in the TC string.

Impact

This issue affects:

  • Consent strings generated for regions requiring specific language variants (e.g., Brazilian Portuguese, Serbian Latin script)
  • Decoding accuracy when reading consent strings
  • Compliance with IAB TCF specifications for language handling

Steps to Reproduce

  1. Set the consent language to an advanced language code (e.g., SR-LATN or PT-BR)
  2. Generate/encode the TC string
  3. Decode the TC string
  4. Observe that the decoded language shows as EN (English) instead of the specified advanced language code (SR-LATN or PT-BR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions