TextEncoder
ClassContains methods for Text encoding
- Available on all platforms
Since Lens Scripting v305
Index
Properties
Methods
Example
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]
Extends
Constructors
Constructor
new TextEncoder():
TextEncoder
Returns
TextEncoder
Overrides
ScriptObject.constructor
Properties
encoding
readonlyencoding:string
The encoding format set in the TextEncoder.
Since
Lens Scripting Version 305
Methods
encode()
encode(
value):Uint8Array
Encodes a string as Uint8Array. utf-8 by default.
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
Uint8Array
Since
Lens Scripting Version 305
encodeInto()
encodeInto(
value,result):void
Encodes and saves the value into the result array.
Parameters
| Parameter | Type |
|---|---|
value | string |
result | Uint8Array |
Returns
void
Since
Lens Scripting Version 306
getTypeName()
staticgetTypeName():TypeName<TextEncoder>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<TextEncoder>
Since
Lens Scripting Version 305
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean