couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Anderson <>
Subject Re: JSON encoding errors
Date Sat, 25 Jul 2009 20:29:11 GMT
On Sat, Jul 25, 2009 at 1:03 PM, Christopher Lenz<> wrote:
> On 25.07.2009, at 21:58, Paul Davis wrote:
>> On Sat, Jul 25, 2009 at 3:54 PM, Chris Anderson<> wrote:
>>> On Sat, Jul 25, 2009 at 8:43 AM, Benoit Chesneau<>
>>> wrote:
>>>> 2009/7/25 Lynton Grice <>:
>>>>> Hi there,
>>>>> I just tried that and it still gives an error. Any other idea?
>>>> I suspect that the lib not mochijson wait do something.
>>>> - benoît
>>> In another thread we narrowed it down to patches on our version of
>>> mochijson2. This hard-to-track error makes me think we should just
>>> rename our version of the library.
>>> Chris
>> Out of curiosity, after the discussion on changing the format, why
>> didn't mochiweb ever take that patch upstream?
> I don't think we ever submitted a patch.

Cross-posting to dev@ again.

I believe I may have had an informal conversation with Bob at the time
our new JSON usage was fresh, and came away thinking he wasn't
interested. Of course this was before we brought it up on the Erlang
list and came to consensus. Also, I might not be remembering this
correctly - which underscores the importance of having discussions on
archived mailing lists.

Looking at the diff between our mochijson2 and the upstream version,
there are a few differences:

Aside from the {struct, proplist()} thing, the biggest is our handling
of numbers, which is simpler than theirs but without falling over to
floating-point notation for large integers. I introduced this change
because the upstream float-conversion was causing us to fail to
round-trip very large numbers that we'd been able to handle before.

Mochijson has also added the ability to output JSON as utf8 instead of
backslash-encoded. This seems like a change we'll certainly want to
absorb. There are also some changes around UTF-16 handling which I'd
have to look at more closely to understand.

I think we should definitely start a discussion with the Mochiweb team
about either merging our renaming our library. I'd also suggest that
we let integrating their new patches wait for the 0.11 branch so we
don't introduce subtle regressions with little time for testing before


> Cheers,
> --
> Christopher Lenz
>  cmlenz at

Chris Anderson

View raw message