Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 6242 invoked from network); 28 Jul 2010 21:14:35 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Jul 2010 21:14:35 -0000 Received: (qmail 52397 invoked by uid 500); 28 Jul 2010 21:14:33 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 52185 invoked by uid 500); 28 Jul 2010 21:14:33 -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 52177 invoked by uid 99); 28 Jul 2010 21:14:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jul 2010 21:14:32 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,NORMAL_HTTP_TO_IP,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of andywoodcock11@gmail.com designates 209.85.215.52 as permitted sender) Received: from [209.85.215.52] (HELO mail-ew0-f52.google.com) (209.85.215.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jul 2010 21:14:25 +0000 Received: by ewy20 with SMTP id 20so2915821ewy.11 for ; Wed, 28 Jul 2010 14:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=1BHouc+cMGt7B0S4hOEmkt+agenwBLPb/icH54hRYlo=; b=U/pVMfYDKFynhvy6R/Vla4mKUrLITmXHhnU09A8uoBrRWdmdNPfc+xfmX9sInR2sPt pLc6CblIjwde5jSFSpti7HHAR3IDD+TXf5GZQAhSu8Beuxdl2aLTTNRSue+LnY1rYeq/ QGrPjSEloPLXgEbKgKOBWC78WbDXqrCQCeq8A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=uZ7tS1cUi5uaRFqhxxsL+iAPHZGES5B2sOnzJIu0KEE+mlhfZez8Qsna6JinbOaioM K3RuGzlsUvNJlJeIBrEdoWVYh4e4+8CGZHrVmDD2edRw1vaOEUKKP2zWnQce0POtabE8 i0A/lpOXCTbMK7AL3Jafkim64fJY5CIzye3/o= Received: by 10.213.29.65 with SMTP id p1mr8859966ebc.36.1280351643785; Wed, 28 Jul 2010 14:14:03 -0700 (PDT) Received: from [89.204.234.132] ([89.204.234.132]) by mx.google.com with ESMTPS id x54sm46043eeh.11.2010.07.28.14.14.01 (version=SSLv3 cipher=RC4-MD5); Wed, 28 Jul 2010 14:14:01 -0700 (PDT) Message-ID: <4C509D97.2040607@gmail.com> Date: Wed, 28 Jul 2010 22:13:59 +0100 From: Andrew Woodcock User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: Curl giving =?windows-1252?Q?=93Invalid_UTF-8_JSON=94_?= =?windows-1252?Q?error_from_CouchDb_although_JSON_is_fine=3F?= =?windows-1252?Q?_Any_ideas=3F?= References: <4C4F4E74.6080908@gmail.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 28/07/2010 08:52, Dave Cottlehuber wrote: > Hi Andrew > > This is a windows thing regarding quoting - a real PITA. Unfortunately > cmd.exe shell on windows doesn't parse this correctly. > The rules for when escaping with a "" or a ^" or a \" are a bit vague > but this works: > > C:\tmp>curl -X PUT > http://@127.0.0.1:5984/albums/6e1295ed6c29495e54cc05947f18c8af -d > "{\"title\":\"There is Nothing Left to Lose\",\"artist\":\"Foo > Fighters\"}" > {"ok":true,"id":"6e1295ed6c29495e54cc05947f18c8af","rev":"1-4b39c2971c9ad54cb37e08fa02fec636"} > > C:\tmp> > > "basically you need to \"escape\" all \"quotes\" within your JSON" > > Is there any way we to get this updated in the online book? > > A+ > Dave > > > On 28 July 2010 09:24, Andrew Woodcock wrote: >> >> Hi there, >> >> this is probably a real noob problem but I am experiencing an issue where >> whenever I try to create a document on CouchDB using curl, I get an "Invalid >> UTF-8 JSON" error. The example I am trying to use is actually from >> O'Reilly's book "CouchDB: The Definitive Guide" and I am pretty sure that I >> have tried it before and got it to work. Here's the command: >> >> |curl-X PUT >> http://username:password@127.0.0.1:5984/albums/6e1295ed6c29495e54cc05947f18c8af >> -d '{"title":"There is Nothing Left to Lose","artist":"Foo Fighters"}' >> | >> >> The database albums exists and the username and password are correct. I have >> checked this with JSONLint and the JSON is valid and I am at a loss ... >> presumably there is an issue with the CouchDB server itself but it appears >> to be running correctly ... any ideas? This is driving me nuts! >> >> I am running CouchDB 0.11 on Windows 7. curl is installed and working >> correctly as far as I can tell. Sofa is working correctly and I can create >> documents via Sofa with no issues. >> >> Thanks, >> >> Andrew >> >> Thank you, that worked. Regards, Andrew