[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How do I make sure that a string is compatible with JSON (utf-8/16/32)?
- From: Coda Highland <chighland@...>
- Date: Wed, 2 Oct 2013 06:58:34 -0700
On Wed, Oct 2, 2013 at 1:01 AM, Owen Shepherd <email@example.com> wrote:
> For UCS4, make sure the code points are in range and aren't surrogates.
> For UTF16, make sure that all the surrogates are paired.
That's a good start but you also have to watch out for illegal
characters -- not every value between U+00000 and U+10FFFF is
permitted even after you take the surrogates out.