unistr()

用于解码带有Unicode转义序列的字符串的函数

unistr() 是一个用于解码带有Unicode转义序列的字符串的系统函数。

unistr() 函数已添加到 PostgreSQL 14 版本中。

用法

unistr ( text ) → text

变更历史

示例

unistr() 的基本用法

postgres=# SELECT unistr('\307B\3052');
 unistr 
--------
 ほげ
(1 row)

具有无效Unicode码点的执行

postgres=# SELECT unistr('\0000');
ERROR:  invalid Unicode code point: 0000

无效Unicode转义的执行

postgres=# SELECT unistr('\+10000');
ERROR:  invalid Unicode escape
HINT:  Unicode escapes must be \XXXX, \+XXXXXX, \uXXXX, or \UXXXXXXXX.

分类

区域设置和字符集处理字符串操作系统函数

反馈

提交关于“unistr()”的任何评论、建议或更正,请在此处 提交