docx
    Preparing search index...

    Function encodeUtf8

    • Encode a string to UTF-8 bytes.

      The copy via new Uint8Array() ensures the returned array uses the current module's Uint8Array constructor, avoiding cross-realm issues in test environments (jsdom) where TextEncoder returns a different realm's Uint8Array that fails instanceof Uint8Array checks.

      Parameters

      • str: string

      Returns Uint8Array