Normalizes a user-supplied encoding label to one TextDecoder accepts.

Unknown labels pass through unchanged so TextDecoder reports the error itself. Labels are matched case-insensitively with '_' and '-' ignored, mirroring how DXF code page names arrive in mixed forms.

  • Parameters

    • encoding: string

      Encoding label such as 'cp949' or 'EUC-KR'.

    Returns string

    A label new TextDecoder(...) accepts in every runtime.