Skip to main content

TextEncoder / TextDecoder

Encodes strings to UTF-8 bytes and decodes bytes back to strings. Specification: encoding.spec.whatwg.org/.

Results​

Probed on 2026-10-19 with Node.js v22.23.3.

warpdom 0.1.6​

Supported

2 of 2 checks work.

Web IDL existence (coverage):

  • TextEncoder: interface present; 3 of 3 members present.
  • TextDecoder: interface present; 4 of 4 members present.
Report a wrong result for warpdom

happy-dom 21.0.3​

Supported

2 of 2 checks work.

The window's value is Node.js's own global (identical object), not the engine's implementation.

Web IDL existence (coverage):

  • TextEncoder: interface present (Node.js's own global); 3 of 3 members present.
  • TextDecoder: interface present (Node.js's own global); 4 of 4 members present.
Report a wrong result for happy-dom

jsdom 30.1.3​

Supported

2 of 2 checks work.

Web IDL existence (coverage):

  • TextEncoder: interface present; 3 of 3 members present.
  • TextDecoder: interface present; 4 of 4 members present.
Report a wrong result for jsdom

linkedom 0.18.13​

Supported

2 of 2 checks work.

The window's value is Node.js's own global (identical object), not the engine's implementation.

Web IDL existence (coverage):

  • TextEncoder: interface present (Node.js's own global); 3 of 3 members present.
  • TextDecoder: interface present (Node.js's own global); 4 of 4 members present.
Report a wrong result for linkedom

Checks​

Exists when: typeof window.TextEncoder is defined.

  • encode-utf8: new TextEncoder().encode("é") returns the UTF-8 bytes [195, 169]. (spec)
  • decode-utf8: new TextDecoder().decode() turns [195, 169] back into "é". (spec)

Node.js globals​

Node.js defines TextEncoder itself. Depending on the test runner and its environment, tests may see Node's version even where the engine's window has none; these results describe the engine's window only.

Working around it in tests​

Node.js has TextEncoder and TextDecoder as globals (also in the "util" module); a setup file can assign them to the test global.