public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vincent-srcware at vinc17 dot net" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug stdio/28943] printf field width specifier is inconsistent between %d and %f for multibyte output
Date: Mon, 25 Sep 2023 13:50:47 +0000	[thread overview]
Message-ID: <bug-28943-131-qZYwIaK3Gn@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28943-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28943

Vincent Lefèvre <vincent-srcware at vinc17 dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vincent-srcware at vinc17 dot net

--- Comment #3 from Vincent Lefèvre <vincent-srcware at vinc17 dot net> ---
Note that ISO C is involved too when the decimal-point character is encoded on
several bytes (e.g. in the ps_AF locale, 2 bytes in UTF-8). See bug 30883.

(In reply to Florian Weimer from comment #0)
> This only applies to the numeric conversions; for (non-wide) strings, field
> width should continue to be measured in bytes, not multibyte characters.

This alone would introduce an inconsistency.

Note also that if you want column alignment, you would need to take into
account the real width of the characters, which may take 0, 1 or 2 columns. So
the character count would not be correct.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-09-25 13:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04  8:12 [Bug stdio/28943] New: " fweimer at redhat dot com
2022-03-04  8:44 ` [Bug stdio/28943] " fweimer at redhat dot com
2022-05-23  9:08 ` cvs-commit at gcc dot gnu.org
2023-02-06 17:42 ` carlos at redhat dot com
2023-09-25 12:39 ` fweimer at redhat dot com
2023-09-25 13:50 ` vincent-srcware at vinc17 dot net [this message]
2024-03-25 14:34 ` schwab@linux-m68k.org

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

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

  git send-email \
    --in-reply-to=bug-28943-131-qZYwIaK3Gn@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.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).