From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 5505523D25 for ; Sun, 25 Feb 2024 11:04:32 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1708855472; b=CkPh0EG8QvbMtdcQ8PZ7stNnxZuVCJe28Fv7YpfX1gJLjnUrI9vc1TpG01aGUsdreKoRV2gOq4 SSB7/shiuf17Vgk8eN7DtMWUUv7YFPLACq6jDbEAkucOApx+KHx3yyr1087gzci7T086A9yIos QWqkjY0Ij49wciCnyNmVnI3ffss+bwspz38T7Xfx3HK4yDEGl+7WY9JZTqEdnwKGqI3a5CNmhk HHUIQnaemuWkWKcP3aL6KJBNCmRLJhM8wxOXXymZdwyw83cf8dlNV2eQ4rjWG59lpudcy1mFwt i4EbtUtjI5NuA4aFGu/2WrR8T1Dc+urnANkHfpMqASf6PA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (relay4-d.mail.gandi.net) smtp.remote-ip=217.70.183.196; dmarc=none header.from=chazelas.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1708855472; bh=XWj2KRPlG20shImDBd/zppg2sSfobQRutHkleY0POrk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:Subject:To:From:Date:DKIM-Signature; b=gYIscHGL0Hd9e8iIgz2AAUu98d2ufBJuWlXBboQb+C/M4UOyysxxmn4e/X572Qx6dmHmUmQtcW lcUUhpCDwe8vlnP+U/PdHQTvF/eTbzsv78f2a96jO5eN1E0x2QPQ/Ltay9y9uwH7RF4tmHtt3Q SSe6JEuc1JIqqKedHX+JcPJ75ArVR36IeAEiDtAURP7Tvk2t76EXoDSyQCVI/3hzMX6Nqb9LeI luNIlIoWGdxpH5+WE6Fe4a48V6gB2K3AA3kv+cm2dBvTrGcslSR/fqkvXoG1iwoCYjv1cVxctg Yh2FRxHC3Ob2VxBu+Vgx0ZoEf8W7idQxM5xKbGuccfWxHg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=oxIDUAi5l2f7lYm26+ue+gghOglnj1Wf8o5cJoQTHy0=; b=h+e9fUwu0lNnxVZYALyeeUctWK IjsWwDhASyuyCxEs2ICTfUiEVF9DIvoa2QTJdvsV49TtsRq6hX3MKHeBYpXXRkHIFKdGWSi73Kfw2 sf+1YYG65ijjPvbQV3UL5d91vcrRYaRuy4VYvuTg099OsRy+WXzl8rcl4FpZvk5b0/y15qgnDGCfB 5fuLNEurdl97mLehqELuXnB5/HCHEl2LX9HU3i9CvB4KPVdD8izlxeAv5O1tCa+gG/WT5j6aGbjHS SOZ7pDvHFpjydpcMt0Wcfq/MVeedIbMAgJuEfP8s0IVs1tnsEOWgHQVElk2jSMOsSf18aYJNU7W93 dCT3jaIQ==; Received: by zero.zsh.org with local id 1reBN2-000GL8-17; Sun, 25 Feb 2024 10:04:32 +0000 Authentication-Results: zsh.org; iprev=pass (relay4-d.mail.gandi.net) smtp.remote-ip=217.70.183.196; dmarc=none header.from=chazelas.org; arc=none Received: from relay4-d.mail.gandi.net ([217.70.183.196]:39575) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1reBMQ-000G1G-6L; Sun, 25 Feb 2024 10:03:56 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id A356BE0005 for ; Sun, 25 Feb 2024 10:03:48 +0000 (UTC) Date: Sun, 25 Feb 2024 10:03:48 +0000 From: Stephane Chazelas To: Zsh hackers list Subject: Missing escaping of C1 control characters for visual representation Message-ID: <20240225100348.sqanit5iusixwdr5@chazelas.org> Mail-Followup-To: Zsh hackers list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-GND-Sasl: stephane@chazelas.org X-Seq: 52605 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: ~$ a=$'\x9f' LC_ALL=fr_FR.iso885915@euro zsh -c $'set -x; echo ${(q+)a}; [[ $a = [[:print:]] ]] || echo no' +zsh:1> echo � � +zsh:1> [[ � = [[:print:]] ]] +zsh:1> echo no no Is ISO8859-x, 0x80 to 0x9f are the C1 control characters (https://en.wikipedia.org/wiki/C0_and_C1_control_codes#C1_controls) Thankfully, my terminal (xterm) above was started in a UTF-8 locale so those control characters are not handled above, and the 0x83 is rendered as � as are bytes >= 0x80 that can't be decoded into characters in UTF-8. With xterm started in that French locale using iso8859-15, it's worse, I see just: +zsh:1> echo % as xterm has interpreted that APC control character. I would expect that 0x9F to be rendered as $'\M-\C-_' like in multibyte locales (or $'\x9f' or $'\x237') -- Stephane