Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 97752 invoked from network); 28 Jul 2010 13:11:45 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Jul 2010 13:11:45 -0000 Received: (qmail 48032 invoked by uid 500); 28 Jul 2010 13:11:44 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 47571 invoked by uid 500); 28 Jul 2010 13:11:41 -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 47355 invoked by uid 99); 28 Jul 2010 13:11:40 -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 13:11:40 +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.180 as permitted sender) Received: from [209.85.215.180] (HELO mail-ey0-f180.google.com) (209.85.215.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jul 2010 13:11:33 +0000 Received: by eyz10 with SMTP id 10so1518870eyz.11 for ; Wed, 28 Jul 2010 06:11:12 -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=OQSOCmT78p0nc3FOxaCx6YpYYnJcfZcnCQCK8LiL2mQ=; b=BYz13Er7GSk1bzg1rakf1wYMIk086rtNveb4/R+LBz+DHk9s7L/6LO4HzchCKRgieK tfROZojcwgQcyFMG8nmGcambojSv8gBPvd2P/0FuHnq/B7carDs+imooridwSKtiHBEk TV4sqciTVCJAYMlLeuPFpTpu5oaRO4NUfWpIA= 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=C6+trUnV57AaD7w1Jqjral+PO9mTPVSQ4Kvr3wqe1U/DtNqXZOB6BC1nEX547y/7J6 n1fgMusRhCnlawcTotjL6LMusWSQYHMsIs31T7fvTcqecQsw2fPmkcxETAa1aNZ9avHM +CQY9FBOYwAFrh8PKkY76VFIQ/LLKkN8lNWYE= Received: by 10.14.45.5 with SMTP id o5mr1282419eeb.55.1280322671929; Wed, 28 Jul 2010 06:11:11 -0700 (PDT) Received: from [89.204.234.132] ([89.204.234.132]) by mx.google.com with ESMTPS id v8sm9487631eeh.20.2010.07.28.06.11.10 (version=SSLv3 cipher=RC4-MD5); Wed, 28 Jul 2010 06:11:10 -0700 (PDT) Message-ID: <4C502C6B.6020807@gmail.com> Date: Wed, 28 Jul 2010 14:11:07 +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 07:24, Sebastian Cohnen wrote: > Hey Andrew, > > I remember people on this ML having problems with escaping/quotes on windows which leads to this kind of error. You could try to save the document to foo.json and curl-X PUT http://username:password@127.0.0.1:5984/albums/6e1295ed6c29495e54cc05947f18c8af -d @foo.json > > Best > > Sebastian > > On 27.07.2010, at 23: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 >> Fantastic! Thank you! That must be about the only combination of escaping I hadn't tried :) and I can confirm that it worked perfectly. I can stop ripping my hair out now ... Regards, Andrew