Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Missing escaping of C1 control characters for visual representation



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




Messages sorted by: Reverse Date, Date, Thread, Author