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: Wed, 10 Aug 2016 17:35:28 +0300 Message-ID: <83bn10hetr.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> <83twf0lb5s.fsf@gnu.org> <83lh07i6g3.fsf@gnu.org> <83k2fri5kc.fsf@gnu.org> <87oa53i3si.fsf@linux-m68k.org> <83bn13i2x2.fsf@gnu.org> <87fuqfhy0q.fsf@linux-m68k.org> <837fbqise6.fsf@gnu.org> <834m6uhu87.fsf@gnu.org> <65f6508f-a464-7f66-fd14-1372dce86aa7@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1470843704 24470 195.159.176.226 (10 Aug 2016 15:41:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 10 Aug 2016 15:41:44 +0000 (UTC) Cc: stakemorii@gmail.com, larsi@gnus.org, schwab@linux-m68k.org, 24117@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 10 17:41:34 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 1bXVdO-00064I-Fh for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Aug 2016 17:41:34 +0200 Original-Received: from localhost ([::1]:42361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXVdL-00027s-CY for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Aug 2016 11:41:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXVc2-0000oN-1j for bug-gnu-emacs@gnu.org; Wed, 10 Aug 2016 11:40:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXVbw-0002nR-1G for bug-gnu-emacs@gnu.org; Wed, 10 Aug 2016 11:40:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXVbv-0002mx-TQ for bug-gnu-emacs@gnu.org; Wed, 10 Aug 2016 11:40:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bXVbu-00016D-OC for bug-gnu-emacs@gnu.org; Wed, 10 Aug 2016 11:40: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: Wed, 10 Aug 2016 15:40: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.14708435514072 (code B ref 24117); Wed, 10 Aug 2016 15:40:02 +0000 Original-Received: (at 24117) by debbugs.gnu.org; 10 Aug 2016 15:39:11 +0000 Original-Received: from localhost ([127.0.0.1]:52409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXVb1-000138-FO for submit@debbugs.gnu.org; Wed, 10 Aug 2016 11:39:10 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXVaw-00012M-KE for 24117@debbugs.gnu.org; Wed, 10 Aug 2016 11:39:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXUbi-0000ux-3T for 24117@debbugs.gnu.org; Wed, 10 Aug 2016 10:35:50 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXUbh-0000ut-W2; Wed, 10 Aug 2016 10:35:46 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3733 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bXUbg-0007UG-CU; Wed, 10 Aug 2016 10:35:45 -0400 In-reply-to: <65f6508f-a464-7f66-fd14-1372dce86aa7@yandex.ru> (message from Dmitry Gutov on Wed, 10 Aug 2016 10:12:40 +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:122029 Archived-At: > Cc: stakemorii@gmail.com, larsi@gnus.org, 24117@debbugs.gnu.org > From: Dmitry Gutov > Date: Wed, 10 Aug 2016 10:12:40 +0300 > > On 08/09/2016 05:50 PM, Eli Zaretskii wrote: > > >> You can't encode it properly without parsing it first. > > > > You don't say what you meant by "encode properly". It's just a > > string, and there are ways to make a string unibyte without any > > parsing. > > Different parts of an URL are supposed to be encoded in different ways. > > For instance, > > http://банки.рф/фыва/ > > turns into > > http://xn--80abwho.xn--p1ai/%D1%84%D1%8B%D0%B2%D0%B0/ Are you saying that url-generic-parse-url performs this encoding, and that using a unibyte buffer causes that to fail? > So I think the encoding of the URL parts should be performed inside > url-http-create-request. Fine with me, but when I suggested that, you didn't like the suggestion. If you changed your mind, let's do that. > On the master branch, host is passed through IDNA encoding, but > real-fname is untouched. On emacs-25, I think we should convert both > to unibyte. Not sure I understand why there should be a difference between the two branches. Encoding an ASCII string doesn't do any harm. > Not sure encode-coding-string is the way to go (why would we assume > UTF-8?). Because using UTF-8 doesn't lose anything, you basically get the same byte stream as stored internally (because 8-bit bytes are not supposed to happen in URLs). > (Why doesn't (encode-coding-string "aaaa" 'ascii) work?) It's 'us-ascii, not 'ascii.