zsh-workers
 help / color / mirror / code / Atom feed
* Missing escaping of C1 control characters for visual representation
@ 2024-02-25 10:03 Stephane Chazelas
  2024-02-25 10:11 ` [Pleae ignore] " Stephane Chazelas
  0 siblings, 1 reply; 2+ messages in thread
From: Stephane Chazelas @ 2024-02-25 10:03 UTC (permalink / raw)
  To: Zsh hackers list

~$ 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Pleae ignore] Missing escaping of C1 control characters for visual representation
  2024-02-25 10:03 Missing escaping of C1 control characters for visual representation Stephane Chazelas
@ 2024-02-25 10:11 ` Stephane Chazelas
  0 siblings, 0 replies; 2+ messages in thread
From: Stephane Chazelas @ 2024-02-25 10:11 UTC (permalink / raw)
  To: Zsh hackers list

2024-02-25 10:03:48 +0000, Stephane Chazelas:
[...]
> I would expect that 0x9F to be rendered as $'\M-\C-_' like in
> multibyte locales (or $'\x9f' or $'\x237')
[...]

And it does in the current version.

Sorry, my bad, I was testing on Ubuntu 22.04's 5.8.1.

-- 
Stephane


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-25 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-25 10:03 Missing escaping of C1 control characters for visual representation Stephane Chazelas
2024-02-25 10:11 ` [Pleae ignore] " Stephane Chazelas

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).