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: Obsolete string-to-multibyte hard to replace Date: Tue, 30 May 2017 00:03:08 -0400 Message-ID: References: <83fufnftf8.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1496117001 31855 195.159.176.226 (30 May 2017 04:03:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 May 2017 04:03:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 30 06:03:18 2017 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 1dFYNJ-0008AZ-Tx for ged-emacs-devel@m.gmane.org; Tue, 30 May 2017 06:03:18 +0200 Original-Received: from localhost ([::1]:51361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFYNP-0002pJ-6I for ged-emacs-devel@m.gmane.org; Tue, 30 May 2017 00:03:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFYNJ-0002p3-3o for emacs-devel@gnu.org; Tue, 30 May 2017 00:03:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFYNI-0006D1-Ar for emacs-devel@gnu.org; Tue, 30 May 2017 00:03:17 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:27854) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dFYNE-00069X-I4; Tue, 30 May 2017 00:03:12 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AWBQA37ixZ/32TCkxcGgEBAQECAQEBAQgBAQEBg1WKbYV/kHMrAZdchh4EAgKCWEQUAQIBAQEBAQEBayiFGQEEAVYeBQULCzQSFBgNJIo1CK5Oi0YBAQEHAiaLLDSKWwEEniOeI4Z8kwqBRDYhgQowIQgwh2Qkii8BAQE X-IPAS-Result: A0AWBQA37ixZ/32TCkxcGgEBAQECAQEBAQgBAQEBg1WKbYV/kHMrAZdchh4EAgKCWEQUAQIBAQEBAQEBayiFGQEEAVYeBQULCzQSFBgNJIo1CK5Oi0YBAQEHAiaLLDSKWwEEniOeI4Z8kwqBRDYhgQowIQgwh2Qkii8BAQE X-IronPort-AV: E=Sophos;i="5.38,417,1491278400"; d="scan'208";a="313928214" Original-Received: from 76-10-147-125.dsl.teksavvy.com (HELO ceviche.home) ([76.10.147.125]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 May 2017 00:03:09 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id D7377662E6; Tue, 30 May 2017 00:03:08 -0400 (EDT) In-Reply-To: <83fufnftf8.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 29 May 2017 20:45:47 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:215340 Archived-At: >> I think it'd make sense to change make-string so it always returns >> a multibyte string, and maybe to also introduce a new make-unibyte-string. > How about an optional argument to make-string instead? You mean (make-string N CHAR &optional UNIBYTE) so it returns multibyte by default (for all chars) unless the new optional arg is provided? Sounds fine, yes. > Anyway, beware of the use case of building and starting Emacs in a > non-ASCII directory, especially when the locale's codeset is not > UTF-8. If we make such changes, these use cases must be audited to > see that they still work, because we use unibyte strings during early > stages of startup in these cases, until we figure out how to decode > them. The likelihood that those code-paths use make-string is fairly low, but of course, it can't be ruled out. Stefan