From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kentaro NAKAZAWA Newsgroups: gmane.emacs.devel Subject: bug#23750: 25.0.95; bug in url-retrieve or json.el Date: Tue, 29 Nov 2016 17:22:50 +0900 Message-ID: <6d0c8c2e-8428-2fdb-0d6e-899f7b9d7ffd@nifty.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1480407826 10316 195.159.176.226 (29 Nov 2016 08:23:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 29 Nov 2016 08:23:46 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 To: dgutov@yandex.ru, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 29 09:23:42 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 1cBdhU-0001TE-Sa for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2016 09:23:41 +0100 Original-Received: from localhost ([::1]:35284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBdhY-0003YC-HP for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2016 03:23:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBdhK-0003Wp-26 for emacs-devel@gnu.org; Tue, 29 Nov 2016 03:23:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBdhF-0007fr-R9 for emacs-devel@gnu.org; Tue, 29 Nov 2016 03:23:30 -0500 Original-Received: from conssluserg-01.nifty.com ([210.131.2.80]:53649) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.71) (envelope-from ) id 1cBdhF-0007eh-7X for emacs-devel@gnu.org; Tue, 29 Nov 2016 03:23:25 -0500 Original-Received: from [192.168.0.5] (nfmv001097188.uqw.ppp.infoweb.ne.jp [222.158.160.188]) (authenticated) by conssluserg-01.nifty.com with ESMTP id uAT8Mp4t013016; Tue, 29 Nov 2016 17:22:51 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com uAT8Mp4t013016 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1480407772; bh=WjaRXeRfPCZvjfTKc3KoSn4MfauGuNh9ZoO1tSp/Tpg=; h=To:References:Subject:From:Date:From; b=fqezLFvMRr4ImGxxgAEDEXsWp4YoCrIsaOAuV8lFiiqtwGZDIHgYxVJFG4Opx8ECl Mfn1Gw2a61mAeCe3VpLPXA6TxJdPpX6oFXO+Kmw9ntdIu+xJpKqSChlsMEWjDfz6jx xmJwzkvaIyVfoKvOkWYX7syqXTRwKn+oulR9Ac8FEHnClgUj1uyvDc0d3V3YUHtLpj 5jY3ic4LVBTtPgInMdZJJ0dcnghWl+TOAEXZN+jYsPTrGrooOORZe0AHBYlVFBbRO0 ZnvOE5V4tvRVG8WM3v4znX2cWq/4DJ2jd5psY4cS0gIHQ4B8w/4yh/mrLew9hO0I+H Tfcc1crkpyFpg== X-Nifty-SrcIP: [222.158.160.188] Original-References: X-MIME-Autoconverted: from 8bit to quoted-printable by conssluserg-01.nifty.com id uAT8Mp4t013016 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 210.131.2.80 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:209707 Archived-At: Why can not I use multibyte text for http requests? The following correct http request will fail. (require 'json) (let* ((content "=E3=81=BB=E3=81=92 <- VALID utf-8 Japanese multibyte tex= t") (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))) =3D> url-http-create-request: Multibyte text in HTTP request: POST /gists HTTP/1.1 Please apply the following patch. --- url-http.el.orig 2016-09-15 17:16:04.000000000 +0900 +++ url-http.el 2016-11-29 17:10:57.018703500 +0900 @@ -351,16 +351,12 @@ (if url-http-data (concat "Content-length: " (number-to-string - (length url-http-data)) + (string-bytes url-http-data)) "\r\n")) ;; End request "\r\n" ;; Any data url-http-data)) - ;; Bug#23750 - (unless (=3D (string-bytes request) - (length request)) - (error "Multibyte text in HTTP request: %s" request)) (url-http-debug "Request is: \n%s" request) request))