From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: bug#23750: 25.0.95; bug in url-retrieve or json.el Date: Wed, 30 Nov 2016 10:31:33 -0500 Message-ID: References: <6d0c8c2e-8428-2fdb-0d6e-899f7b9d7ffd@nifty.com> <8053af81-80e1-a24a-f649-8ffc86963ed5@nifty.com> <0cc7fab4-9a2c-6a8d-def7-36bd50317ca3@yandex.ru> <7f9a799f-de88-fd78-0cdc-dac0928f1503@nifty.com> <308bb78f-8be3-092d-d877-e129d340242b@nifty.com> <4dc615e7-ec73-60a5-426e-0d6986f15d76@yandex.ru> <0cb406fb-ffc4-a4ad-557a-2cacc99b8e75@nifty.com> <86ccb4af-5719-c017-26bb-fc06b4c904d2@yandex.ru> <83r35uxkr5.fsf@gnu.org> <83poldqa70.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1480519916 17435 195.159.176.226 (30 Nov 2016 15:31:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 Nov 2016 15:31:56 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 30 16:31:50 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 1cC6rL-0003Dm-Ji for ged-emacs-devel@m.gmane.org; Wed, 30 Nov 2016 16:31:47 +0100 Original-Received: from localhost ([::1]:44667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cC6rP-0002SU-75 for ged-emacs-devel@m.gmane.org; Wed, 30 Nov 2016 10:31:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cC6rI-0002Rw-OM for emacs-devel@gnu.org; Wed, 30 Nov 2016 10:31:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cC6rF-0000Ax-LG for emacs-devel@gnu.org; Wed, 30 Nov 2016 10:31:44 -0500 Original-Received: from [195.159.176.226] (port=34511 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cC6rF-0000Ac-E6 for emacs-devel@gnu.org; Wed, 30 Nov 2016 10:31:41 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cC6r9-0001Tb-98 for emacs-devel@gnu.org; Wed, 30 Nov 2016 16:31:35 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 17 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:G57zzkQP4O2wjV+JCYtaUCsu65c= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:209805 Archived-At: > But when all the strings are either unibyte or pure-ASCII, we could > produce a unibyte string without losing anything. Actually, technically, if we take a multibyte string which only contains pure-ASCII and convert it to unibyte, we lose information: with a multibyte string, we can compare the `size` and the `size_byte` fields, and if they're equal we know we have a pure-ASCII string, whereas with a unibyte string, we'd have to scan the whole string looking for a byte >= 128 to determine that it's pure-ASCII. So maybe the change should be that when concat has to combine a unibyte string and a multibyte string, it should first look to see if the multibyte string has `size == size_byte` and if so, generate a unibyte string. Stefan