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: bug#23750: 25.0.95; bug in url-retrieve or json.el Date: Wed, 30 Nov 2016 17:06:11 +0200 Message-ID: <83poldqa70.fsf@gnu.org> 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> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1480518535 2415 195.159.176.226 (30 Nov 2016 15:08:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 Nov 2016 15:08:55 +0000 (UTC) Cc: larsi@gnus.org, emacs-devel@gnu.org, kentaro.nakazawa@nifty.com, dgutov@yandex.ru To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 30 16:08:51 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 1cC6V8-0008L7-1p for ged-emacs-devel@m.gmane.org; Wed, 30 Nov 2016 16:08:50 +0100 Original-Received: from localhost ([::1]:44563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cC6VB-00087B-Kd for ged-emacs-devel@m.gmane.org; Wed, 30 Nov 2016 10:08:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cC6Sb-0006Mx-Jj for emacs-devel@gnu.org; Wed, 30 Nov 2016 10:06:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cC6SW-0004wF-Ik for emacs-devel@gnu.org; Wed, 30 Nov 2016 10:06:13 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cC6SW-0004w6-FX; Wed, 30 Nov 2016 10:06:08 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2115 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cC6SV-0006j7-Ku; Wed, 30 Nov 2016 10:06:08 -0500 In-reply-to: (message from Philipp Stephani on Tue, 29 Nov 2016 23:09:57 +0000) 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:209799 Archived-At: > From: Philipp Stephani > Date: Tue, 29 Nov 2016 23:09:57 +0000 > Cc: larsi@gnus.org, kentaro.nakazawa@nifty.com, emacs-devel@gnu.org > > > json-encode returns a multibyte string. > > Any idea why? > > Because (symbol-name 'false) returns a multibyte string. I guess the ultimate reason is that the reader always > creates multibyte strings for symbol names. I'm not sure I understand how symbol-name comes into play here. Can you help me understand this? > Is it again that 'concat' misfeature, when one of the > strings is pure-ASCII, but happens to be multibyte? > > Why is it a misfeature? Because a pure-ASCII string doesn't need to be multibyte, it's only becomes that by accident. The net results is that this misfeature gets in the way when you want to produce a unibyte string by concatenating an encoded string and some ASCII text. > I'd expect a concatenation of multibyte and unibyte strings to either implicitly upgrade > to as multibyte string (as in Python 2) or raise a signal (as in Python 3). But when all the strings are either unibyte or pure-ASCII, we could produce a unibyte string without losing anything.