Re: Ways to detect that XXXX in JSON \uXXXX does not correspond to a Unicode character?

From: Daniel Bünzli <daniel.buenzli_at_erratique.ch>
Date: Fri, 8 May 2015 13:04:08 +0200

Le vendredi, 8 mai 2015 à 05:08, Philippe Verdy a écrit :
> The RFC is jsut informative not normative,

RFC 7159 is not informational, it is a proposed standard.

> Try by yourself, you can perfectly send JSON text containing '\uFFFF' (non-character) or '\uF800' (unpaired surrogate) and I've not seen any JSON implementation complaining about one or the other,
Well now you have (mine). The RFC is very clear that we are dealing with *text-based* data not *binary* data. Maybe programming languages that represent their Unicode strings as possibly invalid UTF-16 sequences will happily input this but as section 8.2 mentions that may not be the case everywhere, software receiving these values "might return different values for the length of a string value or even suffer fatal runtime exceptions".

Best,

Daniel
Received on Fri May 08 2015 - 06:05:14 CDT

This archive was generated by hypermail 2.2.0 : Fri May 08 2015 - 06:05:15 CDT