lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 11.2016 at 00:38, Doug Gale wrote:
> The JSON RFC is as clear as day about JSON having hex escaped UTF-16
> surrogate pairs to encode Unicode characters outside the basic
> multilingual plane (>= 0x10000) I am surprised that JSON parsers are
> completely violating the spec.

Which parsers are you talking about? My parsers support escaped
surrogate pairs (as long as my test suite is correct). Most other Lua
JSON parsers do so as well (see <http://lua-users.org/wiki/JsonModules>).

In case you were referring to this:

>     The only "red" flags I saw in the test results was the lack of UTF-16
>     support. Indeed, that is something I intentionally left out, as I had
>     never seen a UTF-16 JSON in the wild. If I did, I would probably use a
>     designated Unicode-library for converting it to UTF-8.

What I meant was not the escape codes but the encoding of the entire
JSON text itself.

Best regards,

David