From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#42904: [PATCH] Non-Unicode frame title crashes Emacs on macOS Date: Tue, 18 Aug 2020 10:43:10 +0200 (CEST) Message-ID: <20200818084306.GA89999@breton.holly.idiocy.org> References: <83lfidgtc7.fsf@gnu.org> <838sedgq2x.fsf@gnu.org> <02F52D43-7EAB-4E61-A567-E8CCD11D856B@acm.org> <20200817195610.GA70682@breton.holly.idiocy.org> <3F71EF82-A143-4E3A-AEF3-8A236091891D@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3441"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 42904@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 18 10:44:09 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k7xE0-0000lE-VH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Aug 2020 10:44:09 +0200 Original-Received: from localhost ([::1]:52904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7xE0-0008WB-2B for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Aug 2020 04:44:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7xDu-0008Vx-FS for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2020 04:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50632) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7xDu-0004Ql-6W for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2020 04:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k7xDu-0000mX-3Z for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2020 04:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Aug 2020 08:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42904 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 42904-submit@debbugs.gnu.org id=B42904.15977402022945 (code B ref 42904); Tue, 18 Aug 2020 08:44:02 +0000 Original-Received: (at 42904) by debbugs.gnu.org; 18 Aug 2020 08:43:22 +0000 Original-Received: from localhost ([127.0.0.1]:33945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k7xDF-0000lR-U3 for submit@debbugs.gnu.org; Tue, 18 Aug 2020 04:43:22 -0400 Original-Received: from mailout-l3b-97.contactoffice.com ([212.3.242.97]:33570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k7xDE-0000lF-0N for 42904@debbugs.gnu.org; Tue, 18 Aug 2020 04:43:21 -0400 Original-Received: from smtpauth1.co-bxl (smtpauth1.co-bxl [10.2.0.15]) by mailout-l3b-97.contactoffice.com (Postfix) with ESMTP id 3AF99223; Tue, 18 Aug 2020 10:43:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1597740194; s=20200222-6h9o; d=idiocy.org; i=alan@idiocy.org; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To; l=991; bh=71X479819LWT43b9m1LbKaVIXEVt68myV1cCRpovc28=; b=k0KicsiK9bqglcJaNxi7VMfZ91GALbOxWyJSAuWGFNJRIzgNhzhq/o+4UjRFdl8b vnK/mKjwMp3QqoEA3Oa4Ux3PbRC4283K1EVQSJhxvYfQq7r0pnH8DUgzrVPpA+Tu8zh 6XQfXuWu4pSEAbUg63J8RJzo3guVCa50fAQj40XpegwihaD8twOwfjzhlNdsitz55tL BdRby8HasMFDoVT+VfZGNLC/KXerBUGuxnKXrKhWT9EUlwSqFmv8VZ/Dxu15TsGtsEt 7oyDPG9sDhx/vHZYc/fuPcLgBQ3AY6xNESQN8HPpgOjKv9sbgNMCSFxBhPSulDubtwO xzEUlBhWIA== Original-Received: by smtp.mailfence.com with ESMTPA ; Tue, 18 Aug 2020 10:43:09 +0200 (CEST) Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id 1AB0C20249B13F; Tue, 18 Aug 2020 09:43:06 +0100 (BST) Mail-Followup-To: Alan Third , Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Eli Zaretskii , 42904@debbugs.gnu.org Content-Disposition: inline In-Reply-To: <3F71EF82-A143-4E3A-AEF3-8A236091891D@acm.org> X-ContactOffice-Account: com:241649512 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:185447 Archived-At: On Tue, Aug 18, 2020 at 10:07:27AM +0200, Mattias Engdegård wrote: > 17 aug. 2020 kl. 21.56 skrev Alan Third : > > > + encoded_name = code_convert_string_norecord (name, Qutf_16le, 1); > > Presumably this should be utf_16be on big-endian platforms. We still support PowerPC macOS, don't we? No, however I imagine we support GNUstep on big endian systems. > > + str = [NSString stringWithCharacters: (const unichar *) SDATA (encoded_name) > > Is SDATA guaranteed to be 16-bit aligned? Doesn't matter on x86 or > PowerPC, but strictly speaking... I've no idea, I adapted the code from make_multibyte_string in alloc.c, and one of it's callers (although I can't remember which right now). I'm expecting Eli to appear and tell me this is the entirely wrong way of doing this. ;) Anyway, as I understand it the internal representation of NS strings are UTF-16, so the conversion through UTF-8 seems a bit of a waste if we can go direct. -- Alan Third