UNISTR

Syntax

UNISTR
(
  str  IN text
)
RETURNS text;

Overview

The UNISTR function converts Unicode escape sequences in the input text to actual Unicode characters and returns them.

The supported escape formats are as follows:

  • \XXXX : 4-digit hexadecimal format

  • \uXXXX : 4-digit hexadecimal format (prefixed with a 'u')

  • \+XXXXXX : hexadecimal format consisting of six digits following the ‘+’ symbol.

  • \UXXXXXXXX : 8-digit hexadecimal format following the ‘U’ symbol.

The function converts to the correct Unicode code points through surrogate pair processing, and raises an error if an invalid surrogate pair is detected.

Parameter

Parameter
Description

str

text type; Target text to convert. The Unicode escape sequences within this string are replaced with actual Unicode characters.

Example

Last updated