Lens Scripting API

    Class TextEncoder

    Contains methods for Text encoding

    js var encoder = new TextEncoder() let originalStr = "\u223e\u0020\u0045\u22c5\u0064\u0061\u0020\u003d\u0020\u0051" let encodedArr = encoder.encode(originalStr) print("encodedArr="+encodedArr) // result is [226,136,190,32,69,226,139,133,100,97]

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    encoding: string

    The encoding format set in the TextEncoder.

    Methods

    • Encodes a string as Uint8Array. utf-8 by default.

      Parameters

      • value: string

      Returns Uint8Array

    • Encodes and saves the value into the result array.

      Parameters

      • value: string
      • result: Uint8Array

      Returns void

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean

    MMNEPVFCICPMFPCPTTAAATR