From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: bug#23750: 25.0.95; bug in url-retrieve or json.el Date: Tue, 29 Nov 2016 13:05:39 +0200 Message-ID: <86ccb4af-5719-c017-26bb-fc06b4c904d2@yandex.ru> References: <6d0c8c2e-8428-2fdb-0d6e-899f7b9d7ffd@nifty.com> <8053af81-80e1-a24a-f649-8ffc86963ed5@nifty.com> <0cc7fab4-9a2c-6a8d-def7-36bd50317ca3@yandex.ru> <7f9a799f-de88-fd78-0cdc-dac0928f1503@nifty.com> <308bb78f-8be3-092d-d877-e129d340242b@nifty.com> <4dc615e7-ec73-60a5-426e-0d6986f15d76@yandex.ru> <0cb406fb-ffc4-a4ad-557a-2cacc99b8e75@nifty.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1480417673 15520 195.159.176.226 (29 Nov 2016 11:07:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 29 Nov 2016 11:07:53 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 Cc: emacs-devel@gnu.org To: Kentaro NAKAZAWA , Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 29 12:07:43 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBgGC-0002Hl-Nj for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2016 12:07:40 +0100 Original-Received: from localhost ([::1]:36082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBgGG-0000yA-HG for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2016 06:07:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBgFP-0000vX-Ja for emacs-devel@gnu.org; Tue, 29 Nov 2016 06:06:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBgFH-0003bc-8n for emacs-devel@gnu.org; Tue, 29 Nov 2016 06:06:48 -0500 Original-Received: from mail-wj0-f170.google.com ([209.85.210.170]:34334) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cBgFH-0003ZR-2D for emacs-devel@gnu.org; Tue, 29 Nov 2016 06:06:43 -0500 Original-Received: by mail-wj0-f170.google.com with SMTP id mp19so141952574wjc.1 for ; Tue, 29 Nov 2016 03:06:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Kcf3+v1TcTwPfi4tOCpEjOh81xoTY8Vb3cX8xHfCdi0=; b=irCVcXW9YMrC/XpgU6v63dQtZheVLQVnODaVSpRM1TIO0DBrWp7ZhKFS01+YrCdud1 UMdcMfhlOhTKC6ROOojhDyHJkGGSKuwcZP2EpBjzqs0jIRyx7j4fZVz66OnQUVV/X4JX 9DD9OkMCoyNHlYMbmr3sKNMRn1Tag1IbNCMFP2QwpoejqfUeBrXw5neovgOKxyMybfIg F3Xevn2g+PYkKUaHdUASJ41BntokfTWNkdnUtB2infzqwl6s09eq87oXF/azdUNAcw8Q oAgjdMWg3OiJL062/bKlEF/U/tUaUEMOS37/ocordUCJzPeXe0rCcnAAEom0FXkXFuy9 OhYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Kcf3+v1TcTwPfi4tOCpEjOh81xoTY8Vb3cX8xHfCdi0=; b=W7Ji/PquxD4kpA80xTXNPO4QXfcZ+kIrflRSBO9R4SymnqreEsG5i5wo8tEpD+Jc8I EuTto5upK/jPTkSxIwLziBVZWqUhdTmUXH4jNSK3o8glICJcBMwS7GKNO3qe1DvK+2Gk hrUbpa6Bbe3uDrXwe621PhSDdU/Cp8WsgSsrDimEwsr22O59q9+Tq8Vy2Aa6I3IQTMWa 9tIN9kc7pM1QdRDv2lUsRccXyOySNgzXlVQM7zD+OS2x8eUEUJEpFm0vJQ15SHBwamvV M+rYC9A1PIF6UjarOw8j+FpYpLhQSmQks2u1eGm8nrx/w9b7yBr9BkOFOtguq+dqDj+d vihQ== X-Gm-Message-State: AKaTC03W0QNmuvRzlFFLxJq9b41FOz1xDBHByfqXvwpDQJemGaWpy7YFW0NwxigZ/Au/fQ== X-Received: by 10.194.22.170 with SMTP id e10mr21974044wjf.125.1480417541881; Tue, 29 Nov 2016 03:05:41 -0800 (PST) Original-Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id w7sm2177927wmd.24.2016.11.29.03.05.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Nov 2016 03:05:41 -0800 (PST) In-Reply-To: <0cb406fb-ffc4-a4ad-557a-2cacc99b8e75@nifty.com> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.210.170 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:209726 Archived-At: On 29.11.2016 13:03, Kentaro NAKAZAWA wrote: > (let* ((content (encode-coding-string > "ほげ <- VALID utf-8 Japanese multibyte text" > 'utf-8)) > (url "https://api.github.com/gists") > (url-request-method "POST") > (url-request-data > (json-encode > `(("description" . "test") > ("public" . false) > ("files" . (("test.txt" . (("content" . ,content))))))))) > (with-current-buffer (url-retrieve-synchronously url) > (buffer-string))) json-encode returns a multibyte string. Try this: (let* ((content "ほげ <- VALID utf-8 Japanese multibyte text") (url "https://api.github.com/gists") (url-request-method "POST") (url-request-data (encode-coding-string (json-encode `(("description" . "test") ("public" . false) ("files" . (("test.txt" . (("content" . ,content))))))) 'utf-8))) (with-current-buffer (url-retrieve-synchronously url) (buffer-string)))