]> granicus.if.org Git - postgresql/commit
Fix unescaping of JSON Unicode escapes, especially for non-UTF8.
authorAndrew Dunstan <andrew@dunslane.net>
Wed, 12 Jun 2013 17:35:24 +0000 (13:35 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Wed, 12 Jun 2013 17:35:24 +0000 (13:35 -0400)
commit78ed8e03c67d7333708f5c1873ec1d239ae2d7e0
tree3e55afe4518926147b449171566cba0ebccdb358
parentc1d729b419ee876c32ddf4ac3a85fa89a6b4a89b
Fix unescaping of JSON Unicode escapes, especially for non-UTF8.

Per discussion  on -hackers. We treat Unicode escapes when unescaping
them similarly to the way we treat them in PostgreSQL string literals.
Escapes in the ASCII range are always accepted, no matter what the
database encoding. Escapes for higher code points are only processed in
UTF8 databases, and attempts to process them in other databases will
result in an error. \u0000 is never unescaped, since it would result in
an impermissible null byte.
doc/src/sgml/func.sgml
src/backend/utils/adt/json.c
src/test/regress/expected/json.out
src/test/regress/expected/json_1.out [new file with mode: 0644]
src/test/regress/sql/json.sql