From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: bug#23750: 25.0.95; bug in url-retrieve or json.el Date: Sat, 03 Dec 2016 21:01:25 +0100 Message-ID: <87r35ordd6.fsf@gnus.org> References: <6d0c8c2e-8428-2fdb-0d6e-899f7b9d7ffd@nifty.com> <83lgw1q9uu.fsf@gnu.org> <83eg1tq8is.fsf@gnu.org> <787e5206-53e0-752f-a339-4608d2f7ad39@yandex.ru> <837f7lq6lg.fsf@gnu.org> <83bmwvpo0o.fsf@gnu.org> <04e2da4e-1fa3-4483-459c-32f272378486@yandex.ru> <8508920e-097f-0b2a-0558-49973ea0def6@yandex.ru> <765199a5-1ca1-da30-9414-93b40f9406d6@yandex.ru> <837f7hmnxn.fsf@gnu.org> 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 1480795359 14360 195.159.176.226 (3 Dec 2016 20:02:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 3 Dec 2016 20:02:39 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 03 21:02:35 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 1cDGW2-00032m-V7 for ged-emacs-devel@m.gmane.org; Sat, 03 Dec 2016 21:02:35 +0100 Original-Received: from localhost ([::1]:52324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDGW6-0005fl-NI for ged-emacs-devel@m.gmane.org; Sat, 03 Dec 2016 15:02:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDGVL-0005eZ-10 for emacs-devel@gnu.org; Sat, 03 Dec 2016 15:01:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cDGVG-00034k-5v for emacs-devel@gnu.org; Sat, 03 Dec 2016 15:01:51 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:39526) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cDGVF-00031z-Vh for emacs-devel@gnu.org; Sat, 03 Dec 2016 15:01:46 -0500 Original-Received: from [62.243.128.162] (helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1cDGV0-0003Z1-QE; Sat, 03 Dec 2016 21:01:32 +0100 In-Reply-To: (Stefan Monnier's message of "Sat, 03 Dec 2016 11:00:42 -0500") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 80.91.224.195 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:209991 Archived-At: Stefan Monnier writes: > IIRC the problem with that is if the string is the result of > concatenating a unibyte and a multibyte string, in which case the string > may only contain bytes (and hence `length` gives the right result) yet > `string-bytes` and `length` will return different results (because the > =E2=89=A5128 bytes are encoded as 2 bytes in the multibyte representation= ). Hm... I see... I think... :-) Can `string-bytes' return a different number than (with-temp-buffer (set-buffer-multibyte nil) (insert string) (buffer-size)) ? In any case, this latter is what we want, because those are the octets that will be transmitted to the server. Unless there's another subtlety I'm not aware of, which seems likely. :-) --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no