You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Th...@ptb.de on 2012/07/03 14:41:34 UTC

different output from 1.1 and 1.2

Dear list,

we have problems with the new couchdb version 1.2.0:

As a minimal example we created a database on a 1.1.1 
(servername: a73435) server and one on 1.2.0 (servername:a73434). 

Than we create a document in each database containing a string with a 
Umlaut (ä).

If we now replicate the databases one in each other we get from version 
1.1.1:

curl http://a73435/umlauttest/bc8616f8f77089e2550d4930920006f0
{
 "_id":"bc8616f8f77089e2550d4930920006f0",
 "_rev":"2-cd5eb92931214669f3f0df062c17f6ea",
 "test":"S\u00e4tze",
             ^^^^^^
 "server":"a73435"
}

 curl http://a73435/umlauttest/5e5b01c479d58c493284992cb1000431
{
 "_id":"5e5b01c479d58c493284992cb1000431",
 "_rev":"2-9c9c2b2283c9853528dae73b2856ec45",
 "test":"S\u00e4tze",
             ^^^^^^
 "server":"a73434"
}
 
however, from 1.2.0 we receive:

 curl http://a73434/umlauttest/bc8616f8f77089e2550d4930920006f0
{
"_id":"bc8616f8f77089e2550d4930920006f0",
 "_rev":"2-cd5eb92931214669f3f0df062c17f6ea",
 "test":"Sätze",
           ^^^^^^
"server":"a73435"
}

 curl http://a73434/umlauttest/5e5b01c479d58c493284992cb1000431
{
"_id":"5e5b01c479d58c493284992cb1000431",
"_rev":"2-9c9c2b2283c9853528dae73b2856ec45",
"test":"Sätze",
             ^^^^^^
"server":"a73434"
}

in other words two different results, disturbing our process chain. 
If we replicate between two 1.1.1 instances we get identical documents 
(with \u00e4) which is fine for us

Don't you think that the first result (result of 1.1.1) is more json like. 


regards from Berlin
Thomas


Re: different output from 1.1 and 1.2

Posted by Robert Newson <rn...@apache.org>.
Both forms are valid Unicode (in UTF-8 encoding). The character in question can be represented directly or as a unicode escape sequence. Both answers are correct and equivalent.

B.

On 3 Jul 2012, at 16:16, Marten Feldtmann wrote:

> From http://www.ietf.org/rfc/rfc4627.txt:
> 
> "
> ...
> JSON text SHALL be encoded in Unicode.  The default encoding is
>   UTF-8.
> ...
> "
> 
> The JSON parser (used) should therefore deliver the same object structure ... regardless of the escaped-format-writing or not.
> 
> Marten
> 
> 
> Am 03.07.2012 15:57, schrieb Thomas.Bock@ptb.de:
>> I'm not quite sure (in the sense that I don't understand)
>> about the word equivalent;
>> but thank you very much so far!


Re: different output from 1.1 and 1.2

Posted by Marten Feldtmann <it...@schrievkrom.de>.
 From http://www.ietf.org/rfc/rfc4627.txt:

"
...
JSON text SHALL be encoded in Unicode.  The default encoding is
    UTF-8.
...
"

The JSON parser (used) should therefore deliver the same object 
structure ... regardless of the escaped-format-writing or not.

Marten


Am 03.07.2012 15:57, schrieb Thomas.Bock@ptb.de:
> I'm not quite sure (in the sense that I don't understand)
> about the word equivalent;
> but thank you very much so far!

Re: different output from 1.1 and 1.2

Posted by Robert Newson <rn...@apache.org>.
I mean that both results are the same. \u00e4 is the same as ä. You'll notice that the "rev" value is the same regardless of which is displayed, and the rev is calculated from all the bytes of the document. Therefore, we can conclude that the doc is byte-for-byte identical. The only thing that changed here is that the character is rendered directly rather than as an escaped unicode sequence.

http://www.fileformat.info/info/unicode/char/E4/index.htm

B.

On 3 Jul 2012, at 14:57, Thomas.Bock@ptb.de wrote:

> I'm not quite sure (in the sense that I don't understand)
> about the word equivalent; 
> but thank you very much so far!
> 
> We have to do some debug stuff ...
> 
> regards
> Thomas
> 
>> 
>> Re: different output from 1.1 and 1.2
>> 
>> Hi Thomas,
>> 
>> The JSON encoder/decoder changed between 1.1 and 1.2. Both of the 
>> results you show are valid JSON (and equivalent). If you could 
>> describe the processing problems you encountered, perhaps we can help 
> more.
>> 
>> B.
>> 
>> On 3 Jul 2012, at 13:41, Thomas.Bock@ptb.de wrote:
>> 
>>> Dear list,
>>> 
>>> we have problems with the new couchdb version 1.2.0:
>>> 
>>> As a minimal example we created a database on a 1.1.1 
>>> (servername: a73435) server and one on 1.2.0 (servername:a73434). 
>>> 
>>> Than we create a document in each database containing a string with a 
>>> Umlaut (ä).
>>> 
>>> If we now replicate the databases one in each other we get from 
> version 
>>> 1.1.1:
>>> 
>>> curl http://a73435/umlauttest/bc8616f8f77089e2550d4930920006f0
>>> {
>>> "_id":"bc8616f8f77089e2550d4930920006f0",
>>> "_rev":"2-cd5eb92931214669f3f0df062c17f6ea",
>>> "test":"S\u00e4tze",
>>>            ^^^^^^
>>> "server":"a73435"
>>> }
>>> 
>>> curl http://a73435/umlauttest/5e5b01c479d58c493284992cb1000431
>>> {
>>> "_id":"5e5b01c479d58c493284992cb1000431",
>>> "_rev":"2-9c9c2b2283c9853528dae73b2856ec45",
>>> "test":"S\u00e4tze",
>>>            ^^^^^^
>>> "server":"a73434"
>>> }
>>> 
>>> however, from 1.2.0 we receive:
>>> 
>>> curl http://a73434/umlauttest/bc8616f8f77089e2550d4930920006f0
>>> {
>>> "_id":"bc8616f8f77089e2550d4930920006f0",
>>> "_rev":"2-cd5eb92931214669f3f0df062c17f6ea",
>>> "test":"Sätze",
>>>          ^^^^^^
>>> "server":"a73435"
>>> }
>>> 
>>> curl http://a73434/umlauttest/5e5b01c479d58c493284992cb1000431
>>> {
>>> "_id":"5e5b01c479d58c493284992cb1000431",
>>> "_rev":"2-9c9c2b2283c9853528dae73b2856ec45",
>>> "test":"Sätze",
>>>            ^^^^^^
>>> "server":"a73434"
>>> }
>>> 
>>> in other words two different results, disturbing our process chain. 
>>> If we replicate between two 1.1.1 instances we get identical documents 
> 
>>> (with \u00e4) which is fine for us
>>> 
>>> Don't you think that the first result (result of 1.1.1) is more json 
> like. 
>>> 
>>> 
>>> regards from Berlin
>>> Thomas
>>> 
>> 
> 


Re: different output from 1.1 and 1.2

Posted by Th...@ptb.de.
I'm not quite sure (in the sense that I don't understand)
about the word equivalent; 
but thank you very much so far!

We have to do some debug stuff ...

regards
Thomas

> 
> Re: different output from 1.1 and 1.2
> 
> Hi Thomas,
> 
> The JSON encoder/decoder changed between 1.1 and 1.2. Both of the 
> results you show are valid JSON (and equivalent). If you could 
> describe the processing problems you encountered, perhaps we can help 
more.
> 
> B.
> 
> On 3 Jul 2012, at 13:41, Thomas.Bock@ptb.de wrote:
> 
> > Dear list,
> > 
> > we have problems with the new couchdb version 1.2.0:
> > 
> > As a minimal example we created a database on a 1.1.1 
> > (servername: a73435) server and one on 1.2.0 (servername:a73434). 
> > 
> > Than we create a document in each database containing a string with a 
> > Umlaut (ä).
> > 
> > If we now replicate the databases one in each other we get from 
version 
> > 1.1.1:
> > 
> > curl http://a73435/umlauttest/bc8616f8f77089e2550d4930920006f0
> > {
> > "_id":"bc8616f8f77089e2550d4930920006f0",
> > "_rev":"2-cd5eb92931214669f3f0df062c17f6ea",
> > "test":"S\u00e4tze",
> >             ^^^^^^
> > "server":"a73435"
> > }
> > 
> > curl http://a73435/umlauttest/5e5b01c479d58c493284992cb1000431
> > {
> > "_id":"5e5b01c479d58c493284992cb1000431",
> > "_rev":"2-9c9c2b2283c9853528dae73b2856ec45",
> > "test":"S\u00e4tze",
> >             ^^^^^^
> > "server":"a73434"
> > }
> > 
> > however, from 1.2.0 we receive:
> > 
> > curl http://a73434/umlauttest/bc8616f8f77089e2550d4930920006f0
> > {
> > "_id":"bc8616f8f77089e2550d4930920006f0",
> > "_rev":"2-cd5eb92931214669f3f0df062c17f6ea",
> > "test":"Sätze",
> >           ^^^^^^
> > "server":"a73435"
> > }
> > 
> > curl http://a73434/umlauttest/5e5b01c479d58c493284992cb1000431
> > {
> > "_id":"5e5b01c479d58c493284992cb1000431",
> > "_rev":"2-9c9c2b2283c9853528dae73b2856ec45",
> > "test":"Sätze",
> >             ^^^^^^
> > "server":"a73434"
> > }
> > 
> > in other words two different results, disturbing our process chain. 
> > If we replicate between two 1.1.1 instances we get identical documents 

> > (with \u00e4) which is fine for us
> > 
> > Don't you think that the first result (result of 1.1.1) is more json 
like. 
> > 
> > 
> > regards from Berlin
> > Thomas
> > 
> 


Re: different output from 1.1 and 1.2

Posted by Robert Newson <rn...@apache.org>.
Hi Thomas,

The JSON encoder/decoder changed between 1.1 and 1.2. Both of the results you show are valid JSON (and equivalent). If you could describe the processing problems you encountered, perhaps we can help more.

B.

On 3 Jul 2012, at 13:41, Thomas.Bock@ptb.de wrote:

> Dear list,
> 
> we have problems with the new couchdb version 1.2.0:
> 
> As a minimal example we created a database on a 1.1.1 
> (servername: a73435) server and one on 1.2.0 (servername:a73434). 
> 
> Than we create a document in each database containing a string with a 
> Umlaut (ä).
> 
> If we now replicate the databases one in each other we get from version 
> 1.1.1:
> 
> curl http://a73435/umlauttest/bc8616f8f77089e2550d4930920006f0
> {
> "_id":"bc8616f8f77089e2550d4930920006f0",
> "_rev":"2-cd5eb92931214669f3f0df062c17f6ea",
> "test":"S\u00e4tze",
>             ^^^^^^
> "server":"a73435"
> }
> 
> curl http://a73435/umlauttest/5e5b01c479d58c493284992cb1000431
> {
> "_id":"5e5b01c479d58c493284992cb1000431",
> "_rev":"2-9c9c2b2283c9853528dae73b2856ec45",
> "test":"S\u00e4tze",
>             ^^^^^^
> "server":"a73434"
> }
> 
> however, from 1.2.0 we receive:
> 
> curl http://a73434/umlauttest/bc8616f8f77089e2550d4930920006f0
> {
> "_id":"bc8616f8f77089e2550d4930920006f0",
> "_rev":"2-cd5eb92931214669f3f0df062c17f6ea",
> "test":"Sätze",
>           ^^^^^^
> "server":"a73435"
> }
> 
> curl http://a73434/umlauttest/5e5b01c479d58c493284992cb1000431
> {
> "_id":"5e5b01c479d58c493284992cb1000431",
> "_rev":"2-9c9c2b2283c9853528dae73b2856ec45",
> "test":"Sätze",
>             ^^^^^^
> "server":"a73434"
> }
> 
> in other words two different results, disturbing our process chain. 
> If we replicate between two 1.1.1 instances we get identical documents 
> (with \u00e4) which is fine for us
> 
> Don't you think that the first result (result of 1.1.1) is more json like. 
> 
> 
> regards from Berlin
> Thomas
>