bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#31138: Native json slower than json.el


From: Dmitry Gutov
Subject: bug#31138: Native json slower than json.el
Date: Tue, 23 Apr 2019 13:44:27 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 23.04.2019 13:38, Eli Zaretskii wrote:
It's special in the sense that both the JSON RFC and Jansson require
UTF-8 for interchange, so we don't have to deal with raw bytes and can
assume all text is UTF-8-encoded.
We agreed to disagree about this long ago.  Can we please stop arguing
about this time and again?

Even if we don't intend to trust Jansson on this, returning valid UTF-8 is in the contract. So it should be perfectly reasonable to discard any invalid UTF-8 strings it returns and signal an error, rather than try to somehow decode them.

Leading to easier to follow code, for one thing. Right now it's not obvious that the "else" branch should never be taken in practice.

At this point I'm out of arguments. It is, of course, your call.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]