From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] url: Wrap cookie headers in url-http--encode-string. Date: Wed, 07 Sep 2016 20:15:48 +0300 Message-ID: <83bmzzaawr.fsf@gnu.org> References: <20160907153014.15752-1-toke@toke.dk> <87inu7k5z4.fsf@toke.dk> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1473268587 10518 195.159.176.226 (7 Sep 2016 17:16:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 7 Sep 2016 17:16:27 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Toke =?iso-8859-1?Q?H=F8iland-J=F8rgensen?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 07 19:16:22 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 1bhgSS-0001rC-WD for ged-emacs-devel@m.gmane.org; Wed, 07 Sep 2016 19:16:21 +0200 Original-Received: from localhost ([::1]:42143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhgSP-0006Wb-SH for ged-emacs-devel@m.gmane.org; Wed, 07 Sep 2016 13:16:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhgSK-0006Vh-B3 for emacs-devel@gnu.org; Wed, 07 Sep 2016 13:16:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhgSG-0002Ft-2L for emacs-devel@gnu.org; Wed, 07 Sep 2016 13:16:11 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhgSF-0002Fh-VG; Wed, 07 Sep 2016 13:16:07 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2199 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bhgSD-0000Du-Fe; Wed, 07 Sep 2016 13:16:06 -0400 In-reply-to: <87inu7k5z4.fsf@toke.dk> (message from Toke =?iso-8859-1?Q?H?= =?iso-8859-1?Q?=F8iland-J=F8rgensen?= on Wed, 07 Sep 2016 18:52:15 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:207259 Archived-At: > From: Toke Høiland-Jørgensen > Date: Wed, 07 Sep 2016 18:52:15 +0200 > Cc: emacs-devel@gnu.org > > Right, well, I'm not actually sure that there's any multibyte *content* > in the cookie header. But somehow, without this patch, if there's an > UTF-8 payload, (string-bytes request) returns an extra byte for each > UTF-8 octet. I have no idea why that is; basically, what I would see was: > > (string-bytes url-http-data) == (length url-http-data) > > but > > (string-bytes (substring request (* -1 (length (url-http-data))))) being > two bytes longer (for a single UTF-8 character in the payload). Can you show a test case where this happens?