From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3104A3858C62; Mon, 6 Feb 2023 17:57:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3104A3858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675706247; bh=LBoavBCGuGbBIcNSm9cUA7XPJSMygvLvmKLoTEMztI0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iiMysradsQnKR6iTJMjz57owWibZH8y85D6BNBUitszP7a/XqF/1BXtnhemyEa2iJ UZEQeUwAaIinwE568ATsfdbbUwLGk3EhWTvzJEfvwuYABQjGgr/Pstpg1sh/3Y9uIa y3O/RSpFLzc6fFunOq0W4Sp5LI6uG86A2IzGuVkg= From: "carlos at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/28944] strfmon field width is inconsistent with %f formatting Date: Mon, 06 Feb 2023 17:57:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: carlos at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28944 Carlos O'Donell changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |carlos at redhat dot com --- Comment #2 from Carlos O'Donell --- (In reply to Florian Weimer from comment #0) > strfmon field width currently counts bytes, not characters, unlike printf > (bug 28943). This does not seem useful for localization purposes. >=20 > POSIX.1-2017 requires counting bytes. If the standard says bytes then I think this should remain at bytes even th= ough it is less than useful for localization purposes. In order to make a logical minimum column size the application will need to= use nl_langinfo to determine various parameters, count bytes, and then pass an adjusted field width in bytes based on the application logic. It would be easier to pass in a character count, but that is not the case today. The standard would have to be expanded to have a "character count width" rather than "width" in this case. I'm of the opinion that this is likely a CLOSED / WONTFIX, but that this bug can be used to document the current implementation position on the issue. Note: Even for %s/%S there is confusion in the standard about "characters (bytes)" which means the word "character" is often used for the char type rather than logical characters. --=20 You are receiving this mail because: You are on the CC list for the bug.=