/
telnov.ob
/
postgresql-patterns-library
Обзор
Документация
Войти
/
telnov.ob
/
postgresql-patterns-library
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
functions/json/json_unicode_unescape.sql
22 строки
681 B
rin-nas
language sql RETURN expression
14 апр 2026, 13:54
14 апр 2026, 13:54
cfbed9d
Код
Авторство
О чём код?
create or replace function public.json_unicode_unescape(json) returns json immutable returns null on null input parallel safe language sql set search_path = '' return $1::jsonb::json; comment on function public.json_unicode_unescape(json) is $$ Evaluate escaped Unicode characters in the argument. Unicode characters can be specified as \uXXXX (4 hexadecimal digits). Hint: convert json column to jsonb. $$; --TEST do $$ begin assert public.json_unicode_unescape('"''\u017D\u010F\u00E1r, \\Нello\r\n\t \u270C, Привет! \ud83d\udc18\ud83d\ude03"'::json)::text = '"''Žďár, \\Нello\r\n\t ✌, Привет! 🐘😃"'; end; $$;