zsh-workers
 help / color / mirror / code / Atom feed
* Disable UTF8-escaping diacritics
@ 2024-02-20 19:25 Avid Seeker
  2024-02-20 22:56 ` Bart Schaefer
  2024-02-21  0:16 ` Mikael Magnusson
  0 siblings, 2 replies; 3+ messages in thread
From: Avid Seeker @ 2024-02-20 19:25 UTC (permalink / raw)
  To: zsh-workers

Currently, it is not possible to input Arabic Diacritics in a zsh prompt.

E.g: pasting this in zsh:

$ echo السَّلامُ

Results in

$ echo الس<0651><064e>لام<064f>

While this is often desirable when dealing with some Unicode characters,
especially when dealing with hidden characters like ZWNJ, it is not 
helpful when inputting Arabic text.

See: https://en.wikipedia.org/wiki/Arabic_diacritics for the Unicode entries
and more examples.


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

* Re: Disable UTF8-escaping diacritics
  2024-02-20 19:25 Disable UTF8-escaping diacritics Avid Seeker
@ 2024-02-20 22:56 ` Bart Schaefer
  2024-02-21  0:16 ` Mikael Magnusson
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2024-02-20 22:56 UTC (permalink / raw)
  To: Avid Seeker; +Cc: zsh-workers

On Tue, Feb 20, 2024 at 11:26 AM Avid Seeker <avidseeker7@protonmail.com> wrote:
>
> Currently, it is not possible to input Arabic Diacritics in a zsh prompt.

Just to clarify, this means entering diacritics as part of a command
line, rather than including them in e.g. the PS1 string.

> $ echo الس<0651><064e>لام<064f>

I can reproduce this in the stock zsh 5.7.1 on MacOS Catalina, but
cannot reproduce it with a rebuilt 5.7.1 or later using the current
Xcode tools.

The more recent builds do not get this entirely right -- the cursor
placement is messed up, which leads me to believe that e.g. wcwidth()
is returning wrong values for the Arabic glyphs -- but there is no
conversion of the diacritics to hexadecimal.

Unfortunately there's not much zsh can do about this without help from
libraries that describe the characters being used.  Do you have the
appropriate Arabic locale installed?

https://help.gooddata.com/cloudconnect/manual/locale.html

Is your LANG environment etc. set to the correct value from that list?
 I don't currently have any ar_* locales available with which to test,
which may be the reason for the cursor placement problems I observe.

You might try using "zmodload zsh/langinfo" to investigate further.


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

* Re: Disable UTF8-escaping diacritics
  2024-02-20 19:25 Disable UTF8-escaping diacritics Avid Seeker
  2024-02-20 22:56 ` Bart Schaefer
@ 2024-02-21  0:16 ` Mikael Magnusson
  1 sibling, 0 replies; 3+ messages in thread
From: Mikael Magnusson @ 2024-02-21  0:16 UTC (permalink / raw)
  To: Avid Seeker; +Cc: zsh-workers

On 2/20/24, Avid Seeker <avidseeker7@protonmail.com> wrote:
> Currently, it is not possible to input Arabic Diacritics in a zsh prompt.
>
> E.g: pasting this in zsh:
>
> $ echo السَّلامُ
>
> Results in
>
> $ echo الس<0651><064e>لام<064f>
>
> While this is often desirable when dealing with some Unicode characters,
> especially when dealing with hidden characters like ZWNJ, it is not
> helpful when inputting Arabic text.
>
> See: https://en.wikipedia.org/wiki/Arabic_diacritics for the Unicode
> entries
> and more examples.

Try with setopt COMBINING_CHARS, but arabic is never going to look
very readable in a cell-based system like a terminal.

-- 
Mikael Magnusson


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

end of thread, other threads:[~2024-02-21  0:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-20 19:25 Disable UTF8-escaping diacritics Avid Seeker
2024-02-20 22:56 ` Bart Schaefer
2024-02-21  0:16 ` Mikael Magnusson

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).