Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 87792 invoked from network); 9 Dec 2009 12:56:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Dec 2009 12:56:37 -0000 Received: (qmail 16629 invoked by uid 500); 9 Dec 2009 12:56:35 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 16539 invoked by uid 500); 9 Dec 2009 12:56:35 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 16529 invoked by uid 99); 9 Dec 2009 12:56:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2009 12:56:35 +0000 X-ASF-Spam-Status: No, hits=4.3 required=10.0 tests=SPF_PASS,WEIRD_PORT,WEIRD_QUOTING X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of andrew.melo@gmail.com designates 209.85.221.179 as permitted sender) Received: from [209.85.221.179] (HELO mail-qy0-f179.google.com) (209.85.221.179) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2009 12:56:27 +0000 Received: by qyk9 with SMTP id 9so6610394qyk.30 for ; Wed, 09 Dec 2009 04:56:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=tFTV67AO1S3JLJLlsfBfCiivZQyaSCcbnrBzl+NJZeU=; b=xwtF8WDu27UZp1GiXZrcP1HV6F3TjSpgHK1PGjLNQbxhcCjPwEXvdXNoQWCFkAaGoz b9Z6KJv4PqJShkKjNhyiQ6F8G6YidAUUwX1BdT3LLeAg4hvf7sCqDN5bA8Lu7TQ+IWVK QRvHyuWV/mYPVFd/dmJl1gkDNnSqzy+gcV15k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=MrBrh9507MGvw+DNPLGcNdKpuDyzymuO+I5VhEW0bkHXpmfYoFyFZq7XJ6XnawKQ1B vB7WSgYvDC7XpOEnpz6u7cXD5auG4hmPoYLTV+m7VIBEpQAfhFjeHZJWOhElpGb245k7 /Fubm4Rg62e5XxFWyPuhvJ+oqPkwDSsky+/14= MIME-Version: 1.0 Received: by 10.224.106.207 with SMTP id y15mr5524710qao.14.1260363365832; Wed, 09 Dec 2009 04:56:05 -0800 (PST) In-Reply-To: <1df0d0a40912090452r7de0e97aiacff6c9c3ec3865a@mail.gmail.com> References: <856CEEAD-2AB5-46B9-9D8F-09B03D3A22AA@googlemail.com> <1df0d0a40912081904p294edecbl30b4db980fc4c221@mail.gmail.com> <4B1F1E2F.2090509@gmail.com> <1df0d0a40912090452r7de0e97aiacff6c9c3ec3865a@mail.gmail.com> Date: Wed, 9 Dec 2009 13:56:05 +0100 Message-ID: Subject: Re: AW: Re: AW: Re: {"error":"bad_request","reason":"invalid UTF-8 JSON"} From: Andrew Melo To: user@couchdb.apache.org Cc: mhammond@skippinet.com.au Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org what about: curl -X POST http://localhost:5984/test/ -d "{\"title\":\"There is Nothing Left to Lose\",\"artist\":\"Foo Fighters\"}" (different way to escape) On Wed, Dec 9, 2009 at 1:52 PM, Kamyar Navidan wrote: >> >> =C2=A0So something like: > > > > > % curl -X POST http://localhost:5984/test/ -d "{""title"":""There is Noth= ing > Left to Lose"",""artist"":""Foo Fighters""}" > > > Will work. > > No it doesn't. This is what I get: > > C:\Users\Kamyar> curl -X POST http://localhost:5984/zxc/ -d > "{""title"":""There > is Nothing Left to Lose"",""artist"":""Foo Fighters""}" > {"error":"bad_request","reason":"invalid UTF-8 JSON"} > curl: (6) Could not resolve host: is; No data record of requested type > curl: (6) Could not resolve host: Nothing; No data record of requested ty= pe > curl: (6) Could not resolve host: Left; No data record of requested type > curl: (6) Could not resolve host: to; No data record of requested type > curl: (6) Could not resolve host: Lose,artist:Foo; No data record of > requested t > ype > > On Wed, Dec 9, 2009 at 7:19 AM, Mark Hammond wr= ote: > >> On 9/12/2009 2:04 PM, Kamyar Navidan wrote: >> >>> I had the same problem with cmd.exe. Seemingly it cannot emit utf-8. I >>> solved this problem by using Power Shell (win7). >>> >> >> It appears there is only ascii in your example. =C2=A0I think you are ju= st >> hitting the different quoting rules of cmd.exe - specifically, single qu= otes >> are not special and double quotes must be "doubled" to be quoted. =C2=A0= So >> something like: >> >> >> >> % curl -X POST http://localhost:5984/test/ -d "{""title"":""There is >> Nothing Left to Lose"",""artist"":""Foo Fighters""}" >> >> Will work. >> >> HTH, >> >> Mark >> > --=20 -- Andrew Melo Andrew.Melo@gmail.com