TransWikia.com

zsh: indic fonts support rendering issue which is working fine on bash

Unix & Linux Asked on October 31, 2021

I am using gnome-terminal 3.36 version
In bash I can type without issues

$ अखिल् 

In zsh it’s not showing properly

$ अखिल<094d>

zsh indic fonts

this is zsh behaviour for indic fonts which are working fine in bash.

One Answer

If you run info zsh 'special characters' (assuming you have the zsh documentation in info format installed), you'll see:

Unprintable multibyte characters

This item applies to control characters not in the ASCII range, plus other characters as follows. If the MULTIBYTE option is in effect, multibyte characters not in the ASCII character set that are reported as having zero width are treated as combining characters when the option COMBINING_CHARS is on. If the option is off, or if a character appears where a combining character is not valid, the character is treated as unprintable.

Unprintable multibyte characters are shown as a hexadecimal number between angle brackets. The number is the code point of the character in the wide character set; this may or may not be Unicode, depending on the operating system.

$ unicode $'u94d'
U+094D DEVANAGARI SIGN VIRAMA
UTF-8: e0 a5 8d UTF-16BE: 094d Decimal: &#2381; Octal: 4515

Category: Mn (Mark, Non-Spacing); East Asian width: N (neutral)
Unicode block: 0900..097F; Devanagari
Bidi: NSM (Non-Spacing Mark)

Combining: 9 (Viramas)

So that U+094D character is in that category.

Run

set -o combiningchars

If you want zle to handle combining characters.

Same applies for the U+0301 combining acute accent in Stéphane for instance which zle renders as Ste<0301>phane without that option (my preference personally, as I like to be aware that there are actually two characters that make up that instead of the usual U+00E9 pre-composed é).

Answered by Stéphane Chazelas on October 31, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP