Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 752126 - app-misc/gcal-4.1: broken alignment when unicode chars present
Summary: app-misc/gcal-4.1: broken alignment when unicode chars present
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Shell Tools Herd Bugs
Depends on:
Reported: 2020-11-01 15:35 UTC by Nikita Zlobin
Modified: 2020-11-01 17:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Zlobin 2020-11-01 15:35:22 UTC
When printing eternal events list, words with russian letters before them are aligned as if russian letters occupied two places instead of one.

Reproducible: Always

Steps to Reproduce:
1. Try this (assuming russian locale, no idea with others, to have multibyte/national chars in output):
$ gcal -i- --date-format='%1 %<02*D %<20u*U %Y %2' --cc-holidays=RU -n 2020
1.1. For other locales, different from english (if they have unicode chars in alphabet) you may need to change value for --cc-holidays.
2. Try same command propended with LANG=C.
Actual Results:  
Only second result is properly aligned. In first result it's true only for words without national chars (untranslated). E.g., May word is untranslated, so it has longest indentation before year. Feb and Jan are translated for me, with February longer then January, and intendation after them is less, with least for Feb. Translated (russian) descriptions break indentation so much, that even sign before date may disappear.

Expected Results:  
Correct indentation with all utf chars, supported by terminal.

I have gcal with unicode flag.
Full command I tried:
gcal -i- --date-format='%1 %<02*D %<20u*U %Y %2' --highlighting="$(tput setaf 15)$(tput setab 2)$(tput bold):$(tput sgr0):$(tput setaf 11)$(tput bold):$(tput sgr0)" --cc-holidays=RU -n 2020
(for now I have to stick to %M for month)

My toolchain is somewhat outdated. For example (could affect gcal):
glibc-2.29-r7, gcc-7.4.0-r2, binutils-2.32-r1