Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 82384 invoked from network); 26 Nov 2010 10:51:11 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Nov 2010 10:51:11 -0000 Received: (qmail 55700 invoked by uid 500); 26 Nov 2010 10:51:09 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 55551 invoked by uid 500); 26 Nov 2010 10:51:09 -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 55543 invoked by uid 99); 26 Nov 2010 10:51:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Nov 2010 10:51:08 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of florian.leitner@gmail.com designates 209.85.214.180 as permitted sender) Received: from [209.85.214.180] (HELO mail-iw0-f180.google.com) (209.85.214.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Nov 2010 10:51:00 +0000 Received: by iwn37 with SMTP id 37so2244493iwn.11 for ; Fri, 26 Nov 2010 02:50:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=MP1801UnkeDzEUdCCOY/8cefy+qCXiBTlljA8QYDKUE=; b=VdnY+rUlLIVJT0pOwmFFk/yMZ8BiKmlrrBPxVB2iXnXDEMYj6s/xsxPCPwyrzxcFma PrwD0KdfL6tt5jk6q6Mn4kdCFFX3S6ZrgQmTzFsdVqr3YQR/yJxqTje2nkQrJyBN7t5p GERvxuhaIJKbt/qIfSYTpRrWmb6IPWgD4CzKM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=C8jCJqK06UQPBmEqPeNe31TEvZwY2uccMRUIZonxwzvJOlZks1VomSrVeH1qZmT+NX qT4NF32TJKmZr+PY0e5ZLNQ8r5OG9ILZuKq+4nvS+mXl1+0mV3Dcv8W6iDBV7Dy/OyYj ptBU/blZu0633pp5d7TN1dMk56yBngAtQBwN4= Received: by 10.231.33.129 with SMTP id h1mr1298942ibd.158.1290768639685; Fri, 26 Nov 2010 02:50:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.149.19 with HTTP; Fri, 26 Nov 2010 02:50:19 -0800 (PST) In-Reply-To: References: From: Florian Leitner Date: Fri, 26 Nov 2010 11:50:19 +0100 Message-ID: Subject: Re: curl POST to couchdb's _temp_view on OSX => invalid UTF-8 To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org How embarrassing... Well, thanks lots for the hint! -- Florian On 26 November 2010 10:23, JC de Villa wrote: > You're missing a closing curly bracket before that last single quote. > > JC de Villa > > > On Fri, Nov 26, 2010 at 2:36 AM, Florian Leitner > wrote: > >> Hi there, >> >> I've got a peculiar problem with the UTF-8 encoding in CouchDB. I >> installed the latest CouchDBX.app for >> OSX (CouchDB version 1.0.1, curl version 7.19.7, OSX version 10.6.4) >> and all worked nicely so far. However, now I am trying to POST to the >> _temp_view of my "hello-world" database, and I get the "invalid UTF-8 >> JSON" error without knowing what I am doing wrong - curl worked nicely >> for all other commands and if I run the view from Futon, it works >> nicely, too. Here is what happens with curl (I have three documents in >> "hello-world"): >> >> $ curl-json -vX POST "$DB/_temp_view" -d '{"map": "function(doc) { >> emit(null, doc) }"' >> * About to connect() to 127.0.0.1 port 5984 (#0) >> * =C2=A0 Trying 127.0.0.1... connected >> * Connected to 127.0.0.1 (127.0.0.1) port 5984 (#0) >> > POST /hello-world/_temp_view HTTP/1.1 >> > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 >> OpenSSL/0.9.8l zlib/1.2.3 >> > Host: 127.0.0.1:5984 >> > Accept: */* >> > Content-Type: application/json;charset=3Dutf-8 >> > Content-Length: 43 >> > >> < HTTP/1.1 400 Bad Request >> < Server: CouchDB/1.0.1 (Erlang OTP/R13B) >> < Date: Thu, 25 Nov 2010 18:19:07 GMT >> < Content-Type: text/plain;charset=3Dutf-8 >> < Content-Length: 54 >> < Cache-Control: must-revalidate >> < >> {"error":"bad_request","reason":"invalid UTF-8 JSON"} >> * Connection #0 to host 127.0.0.1 left intact >> * Closing connection #0 >> >> Here is the request against the database (with some spaces between >> key/value pairs to make it readable): >> >> $ curl-json $DB >> {"db_name":"hello-world", "doc_count":3, "doc_del_count":6, >> "update_seq":16, "purge_seq":0, "compact_running":false, >> "disk_size":61529, "instance_start_time":"1290702185923299", >> "disk_format_version":5, "committed_update_seq":16} >> >> Last but not least, I've aliased curl-json as such: >> >> alias curl-json=3D'curl -H"Content-Type: application/json;charset=3Dutf-= 8"' >> >> I've also tried to leave out the charset part, naturally, to no avail. >> DB is set to (as guessed): >> >> DB=3Dhttp://127.0.0.1:5984/hello-world >> >> So can someone tell me why I am getting this UTF-8 issue? I could POST >> documents without encoding problems, put now POSTing to _temp_view seems= to >> fail. Any help appreciated. >> >> Thanks, >> Florian >> >