Re: [dev] [st] possible bug with unicode character

From: Silvan Jegen <s.jegen_AT_gmail.com>
Date: Wed, 13 Apr 2016 10:17:54 +0200

On Tue, Apr 12, 2016 at 11:37 PM, Jochen Sprickerhof
<dwm_AT_jochen.sprickerhof.de> wrote:
> * Marc Collin <marc.collin7_AT_gmail.com> [2016-04-12 16:31]:
>> So this is not a st bug and not a libc bug.
>
> I think it's a libc bug as well, quoting man 3 wcwidth:
>
> "The wcwidth() function returns the number of columns needed to
> represent the wide character c. If c is a printable wide character, the
> value is at least 0. If c is null wide character (L'\0'), the value is
> 0. Otherwise, -1 is returned."
>
> So wcwidth('a') == 1, but wcwidth('☺') == -1 (but I would assume the
> emoji is printable ;) ).

Have you tested it exactly as you wrote it here? Since wcwidth wants a
wchar_t you probably would have to use L'☺'.


Cheers,

Silvan
Received on Wed Apr 13 2016 - 10:17:54 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 13 2016 - 10:24:13 CEST