[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/4] Fix width computation
From: |
Robbie Harwood |
Subject: |
Re: [PATCH v3 1/4] Fix width computation |
Date: |
Thu, 06 Jan 2022 15:43:53 -0500 |
Bruno Haible <bruno@clisp.org> writes:
> Robbie Harwood wrote:
>> From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
>>
>> [rharwood@redhat.com: merge with later fix from pjones@redhat.com]
>> Signed-off-by: Robbie Harwood <rharwood@redhat.com>
>> ---
>> lib/argp-fmtstream.c | 80 +++++++++++++++++++++++++++++++++++++-------
>> lib/argp-help.c | 3 +-
>> lib/mbswidth.c | 15 +++++++++
>> lib/mbswidth.h | 4 +++
>> 4 files changed, 88 insertions(+), 14 deletions(-)
>
> This patch will need several more iterations, as it mixes two good
> ideas, with - so far - imperfect implementations:
>
> * The need to use wcwidth in argp-fmtstream arises because the help
> strings are internationalized. But for internationalized strings,
> line breaking by looking for spaces is just wrong. (It works for
> Russian and Greek but not for Chinese.) A much better algorithm
> (that works for most languages, except Thai) is found in GNU
> libunistring 1.0. But the code in glibc cannot use libunistring; so
> there likely will need to be some '#ifdef _LIBC'.
>
> * The idea to parse escape sequences in a special way, before
> invoking wcwidth, it nice. But's it's far from complete. IMO one
> needs to look at GNU teseq, the ISO 2022 standard, and other
> de-facto standards when implementing that. And it should then be
> implemented in wcswidth, mbswidth, etc. uniformly.
Thank you for the feedback. I will give this a shot, but can't make any
guarantees: from your comments, it seems like a large rework of
something I don't have background in. Given that, and that the patches
in this series are not dependent on each other, it would be nice if this
change did not hold up the rest.
Be well,
--Robbie
signature.asc
Description: PGP signature