Skip to main content
Scalar function
NULL text returns NULL; NULL charset errors.

Syntax

Scalar

Arguments

Returns

  • Type: BINARY
  • Possible values: Encoded bytes.
  • NULL behavior: NULL text returns NULL; NULL charset errors.

Properties

Usage notes

  • Charset is case-insensitive and constant within an evaluated batch. Supported: US-ASCII, ISO-8859-1, UTF-8, UTF-16, UTF-16BE, UTF-16LE. UTF-16 adds a big-endian BOM.
  • US-ASCII replaces non-ASCII characters with ?. ISO-8859-1 replaces code points above 255 with ?.

Examples

Typical behavior

Encode Unicode text as UTF-8

Limitations

  • Unsupported/nonconstant charsets error.
  • ENCODE takes STRING text and a STRING character-set name. BINARY input is not supported.
Last modified on October 15, 2026