Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#58978 - [liboping] UTF-8 prettyping doesn't work

Attached to Project: Community Packages
Opened by Aria Edmonds (missar1a) - Tuesday, 12 June 2018, 07:01 GMT
Last edited by Gaetan Bisson (vesath) - Wednesday, 13 June 2018, 18:57 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Gaetan Bisson (vesath)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The function has_utf8 will always return false, due to arch linux not having ncursesw, just ncurses(https://bugs.archlinux.org/task/17590).
The offending line is quite obvious:

static _Bool has_utf8() /* {{{ */
{
# if HAVE_NCURSESW_NCURSES_H
if (!opt_utf8)
{
/* Automatically determine */
if (strcasecmp ("UTF-8", nl_langinfo (CODESET)) == 0)
opt_utf8 = 2;
else
opt_utf8 = 1;
}
return ((_Bool) (opt_utf8 - 1));
#else
return (0);
#endif
} /* }}} _Bool has_utf8 */

I fixed this locally by changing the line to
# if HAVE_NCURSES_H

and then it works fine.
I documented this on the git: https://github.com/octo/liboping/issues/37



Additional info:
* version 1.10.0-3

~ ❯❯❯ find /usr/include | grep curses
/usr/include/cursesw.h
/usr/include/cursesp.h
/usr/include/cursesm.h
/usr/include/cursesf.h
/usr/include/cursesapp.h
/usr/include/ncurses_dll.h
/usr/include/ncurses.h
/usr/include/curses.h
~ ❯❯❯ echo $LANG
en_AU.UTF-8




Steps to reproduce:
$ noping -g prettyping 8.8.8.8
This task depends upon

Closed by  Gaetan Bisson (vesath)
Wednesday, 13 June 2018, 18:57 GMT
Reason for closing:  Fixed
Additional comments about closing:  liboping-1.10.0-4
Comment by Gaetan Bisson (vesath) - Wednesday, 13 June 2018, 06:33 GMT
As we discussed by email: I cannot reproduce this issue yet we both run the latest ncurses and xterm packages. Please ensure all your software is up-to-date by running `sudo pacman -Syu`.

Can you send us a screenshot of `noping -g prettyping 8.8.8.8` showing the defect?

Could you also tell us what `echo -e '\xe2\x94\x8c\xe2\x94\x80'` outputs in your terminal?

Cheers.
Comment by Aria Edmonds (missar1a) - Wednesday, 13 June 2018, 07:57 GMT
Here we go. It's printing underscores there, but I assure you when my ping spikes it doesn't print the utf characters.
Comment by Gaetan Bisson (vesath) - Wednesday, 13 June 2018, 08:15 GMT
So the line drawing characters that form the box around the ping statistics are fine, and the graph seems good too: those not underscores but U+23BD (HORIZONTAL SCAN LINE-9) which is what I expected. Noping is actually printing utf8 characters in your terminal just fine.

To help us understand the problem could you post two screenshots:
- One with the current Arch package in a situation that exhibits the display issue.
- One with your modified package (with your patch applied) in the same situation showing that the issue is fixed.

Cheers.
Comment by Aria Edmonds (missar1a) - Wednesday, 13 June 2018, 08:25 GMT
Here you go.
Comment by Gaetan Bisson (vesath) - Wednesday, 13 June 2018, 17:16 GMT
Oh. So what you expect is a full histogram bar instead of just a line?

Loading...