From 94e3311b97448324d67ba9a527854271373329d9 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Sat, 8 Jun 2013 09:12:48 -0400 Subject: Handle Unicode surrogate pairs correctly when processing JSON. In 9.2, Unicode escape sequences are not analysed at all other than to make sure that they are in the form \uXXXX. But in 9.3 many of the new operators and functions try to turn JSON text values into text in the server encoding, and this includes de-escaping Unicode escape sequences. This processing had not taken into account the possibility that this might contain a surrogate pair to designate a character outside the BMP. That is now handled correctly. This also enforces correct use of surrogate pairs, something that is not done by the type's input routines. This fact is noted in the docs. --- doc/src/sgml/func.sgml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 2c02fd1e1b4..3adb36579ea 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -10150,6 +10150,15 @@ table2-mapping + + + The json functions and operators can impose stricter validity requirements + than the type's input functions. In particular, they check much more closely that any use + of Unicode surrogate pairs to designate characters outside the Unicode Basic Multilingual + Plane is correct. + + + The extension has a cast from hstore to -- cgit v1.2.3