bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Cc: lasse.collin@tukaani.org
Subject: argp --help formatting bug with non-ASCII characters
Date: Fri, 12 Apr 2024 01:23:49 +0200	[thread overview]
Message-ID: <9787490.CXktyA3mZA@nimes> (raw)

Reported by Lasse Collin:
The argp module from Gnulib has a rendering problem in the --help output
of the program. Namely, it counts bytes when it should count screen columns.

How to reproduce:
1. Build GNU tar (1.33 or 1.35, for example).
2. Install it.
3. You can see misindentation:
$ LC_ALL=de_DE.UTF-8 src/tar --help

...
                             abzubilden
      --mode=ÄNDERUNGEN     den (symbolischen) Modus ÄNDERUNGEN für
                             hinzugefügte Dateien erzwingen
...

$ LC_ALL=fr_FR.UTF-8 src/tar --help
...
                             son nom commence par un tiret)
  -C, --directory=RÉP       Utiliser RÉP comme répertoire de travail
      --exclude=MOTIF        Exclure les fichiers correspondant au MOTIF
...

The .mo file produces separate localizations for the pieces, e.g. "ÄNDERUNGEN"
and "den (symbolischen) Modus ÄNDERUNGEN für hinzugefügte Dateien erzwingen".

The bug is apparently that in argp-fmtstream.c, a character such as Ä or É
augments fs->point_col by 2, when it should only augment it by 1.

In other words, it should use the Gnulib module 'mbswidth'.

Any volunteers?





             reply	other threads:[~2024-04-11 23:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-11 23:23 Bruno Haible [this message]
2024-04-12 16:09 ` argp --help formatting bug with non-ASCII characters Collin Funk
2024-04-12 17:19   ` Bruno Haible
2024-04-12 17:40     ` Collin Funk
2024-04-13 19:03 ` Lasse Collin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9787490.CXktyA3mZA@nimes \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=lasse.collin@tukaani.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).