Re: [dev] [PATCH] [st] Fix issues with wcwidth() returning -1 for unsupported unicode chars

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun, 26 Oct 2014 22:42:49 +0100

On Sun, Oct 26, 2014 at 3:15 AM, dequis <dx_AT_dxzone.com.ar> wrote:
>
> My patch:
>
> Just wcwidth(...) -> abs(wcwidth(...))
>
> In other words: if wcwidth returns -1, interpret that as a column
> width of 1. It's a bit dirty and lazy, but it works wonderfully for
> most characters.
>
> I'm not sure what the "correct" solution would be, but it's definitely
> not something as simple as this - would mean fixing the libc to
> support unicode up to 7.0, or implementing our own version of it.
>
> Opinions?
>

I think your fall-back workaround makes alot of sense until glibc mans
up and implements it (the correct solution). I have tested it locally
with glibc and musl libc, interestingly musl knows the correct
character width.

Kind regards,
Hiltjo
Received on Sun Oct 26 2014 - 22:42:49 CET

This archive was generated by hypermail 2.3.0 : Sun Oct 26 2014 - 22:48:08 CET