Skip to main content

TextDecoder

Class

Contains methods for Text decoding

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Index

Example

js var decoder = new TextDecoder() let decodedStr = decoder.decode([226,136,190,32,69,226,139,133,100,97]) print("decodedString="+decodedStr)

Extends

Constructors

Constructor

new TextDecoder(encoding?): TextDecoder

Parameters

ParameterType
encoding?string

Returns

TextDecoder

Overrides

ScriptObject.constructor

Properties

encoding

readonly encoding: string

The encoding format set in the TextDecoder.

Methods

decode()

decode(data): string

Decodes a Uint8Array as a string. utf8 by default.

Parameters

ParameterType
dataUint8Array

Returns

string


getTypeName()

static getTypeName(): TypeName<TextDecoder>

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<TextDecoder>

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

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

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


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

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame