TextEncoder.encode()

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The TextEncoder.encode method returns a Uint8Array containing the text given in parameters encoded with the specific method for that TextEncoder object.

Syntax

b1 = encoder.encode(string);

Parameters

string
Is a DOMString containing the text to encode.

Specifications

Specification Status Comment
Encoding
The definition of 'TextEncoder.encode()' in that specification.
Living Standard Initial definition.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support38 ?

19

181

No25 No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support3838 ?

19

181

? No ?

1. Firefox 18 implemented an earlier and slightly different version of the specification.

See also

Document Tags and Contributors

Contributors to this page: fscholz, Peppesterest, gregtatum, giffeler, realityking, kscarfone, teoli
Last updated by: fscholz,