IS_UTF8

is_utf8(str)

Function

Determines whether the string str contains only characters encoded in UTF-8.

Parameters

  • str: string

Return Value

  • boolean

Example

> SELECT a, is_utf8(a)
FROM VALUES
  (""),
  ("abcd"),
  ("中文"),
  (",。") AS t(a);
        true
abcd    true
中文    true
,。    true