kinetex - v1.0.0-rc.1
    Preparing search index...

    Function decodeBody

    • Decode bytes to a string with charset detection and fallback.

      Parameters

      • bytes: Uint8Array

        The raw bytes to decode.

      • charset: string | null

        The charset hint from Content-Type (null = utf-8).

      • url: string

        The request URL (for error messages).

      Returns string

      The decoded string.

      If decoding fails even with lenient fallback.