From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24117: 25.1; url-http-create-request: Multibyte text in HTTP request Date: Thu, 04 Aug 2016 20:02:55 +0300 Message-ID: <83twf0lb5s.fsf@gnu.org> References: <83d1ltq3p6.fsf@gnu.org> <83popsocg8.fsf@gnu.org> <7fb3540a-7b74-68cf-2c63-66474de26640@yandex.ru> <83mvkvmbv2.fsf@gnu.org> <27168f12-32d2-cb38-45c0-27d3339c75aa@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1470330270 302 195.159.176.226 (4 Aug 2016 17:04:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 4 Aug 2016 17:04:30 +0000 (UTC) Cc: stakemorii@gmail.com, larsi@gnus.org, 24117@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 04 19:04:22 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1bVM48-00071C-J3 for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Aug 2016 19:04:16 +0200 Original-Received: from localhost ([::1]:40988 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVM45-0000fa-CC for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Aug 2016 13:04:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVM3z-0000fQ-Ng for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 13:04:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVM3u-0000bb-SK for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 13:04:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVM3u-0000bX-OZ for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 13:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bVM3u-0006YH-E5 for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2016 13:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Aug 2016 17:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24117 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24117-submit@debbugs.gnu.org id=B24117.147033021425149 (code B ref 24117); Thu, 04 Aug 2016 17:04:02 +0000 Original-Received: (at 24117) by debbugs.gnu.org; 4 Aug 2016 17:03:34 +0000 Original-Received: from localhost ([127.0.0.1]:55836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVM3S-0006XZ-3c for submit@debbugs.gnu.org; Thu, 04 Aug 2016 13:03:34 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40237) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVM3Q-0006XN-30 for 24117@debbugs.gnu.org; Thu, 04 Aug 2016 13:03:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVM3H-0000Pw-DD for 24117@debbugs.gnu.org; Thu, 04 Aug 2016 13:03:27 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVM2z-0000Ko-Jp; Thu, 04 Aug 2016 13:03:05 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4264 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bVM2y-0005EK-C1; Thu, 04 Aug 2016 13:03:04 -0400 In-reply-to: <27168f12-32d2-cb38-45c0-27d3339c75aa@yandex.ru> (message from Dmitry Gutov on Wed, 3 Aug 2016 05:39:31 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121831 Archived-At: > Cc: stakemorii@gmail.com, 24117@debbugs.gnu.org, > Lars Magne Ingebrigtsen > From: Dmitry Gutov > Date: Wed, 3 Aug 2016 05:39:31 +0300 > > On 08/02/2016 06:25 PM, Eli Zaretskii wrote: > > > How about making the temporary buffer parsed by url-generic-parse-url > > a unibyte buffer? Does that fix the problem? > > It does fix anaconda-mode, yes. Hmm, but url-generic-parse-url is called from gazillion other places, so maybe this is not safe. > > AFAIU, RFC 3986 doesn't > > allow non-ASCII characters, so we should be okay handling that in a > > unibyte buffer, right? > > I don't really know. RFC 3986 or not, I suppose in practice the url > could be quoted before or after it's parsed. And url-parse-tests.el > doesn't specify this case. No, I meant that since RFC 3986 doesn't allow non-ASCII characters, and url-generic-parse-url doesn't do anything about that, it is either already broken for non-ASCII characters, or already copes with them. So we don't need to worry about that. However, a safer change would be to do something like this: (or (not (multibyte-string-p url-http-target-url)) (setq url-http-target-url (decode-coding-string url-http-target-url 'utf-8))) in url-http-create-request. Can you try this? Thanks.