[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] Exposing wcwidth(3) as a built-in function

From: arnold
Subject: Re: [bug-gawk] Exposing wcwidth(3) as a built-in function
Date: Sun, 03 Dec 2017 11:39:25 -0700
User-agent: Heirloom mailx 12.4 7/29/08

Eric Pruitt <address@hidden> wrote:

> On Tue, Nov 28, 2017 at 11:34:30PM -0800, Eric Pruitt wrote:
> > I was able to create a working wcwidth function in pure AWK script
> > without converting characters to numeric codepoints by (ab)using lexical
> > comparisons. I have no clue how portable this is. I've attached the
> > generated file in the event that it might be useful to someone else.
> I decided to make a less hacky, portable version of the wcwidth
> function. The rewritten script is much smaller, and it doesn't kill the
> MAWK parser like its predecessor. Lookups are done using a binary search
> on a table that is lazy-loaded at runtime. I've attached the updated
> script to this email, but the canonical repository is
> https://github.com/ericpruitt/wcwidth.awk .
> Last update on this, I swear ;).
> Eric

Much thanks for this. 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]