bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#20258: 24.5; format-time-string miscounting of multibyte characters


From: Lars Ingebrigtsen
Subject: bug#20258: 24.5; format-time-string miscounting of multibyte characters
Date: Mon, 30 Sep 2019 15:39:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> The POSIX descriptions says bytes.
>
> Right.  So it might be a glibc documentation bug (or maybe the glibc
> manual I have here is outdated).
>
> And there is the issue with non-glibc implementations.

What about something appropriately vague like the following patch to
draw attention to the issue:

diff --git a/src/timefns.c b/src/timefns.c
index 330d5623f0..20f7ccb7d7 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -1437,8 +1437,11 @@ DEFUN ("format-time-string", Fformat_time_string, 
Sformat_time_string, 1, 3, 0,
 `^' Use upper case characters if possible.
 `#' Use opposite case characters if possible.
 
-A field width N is an unsigned decimal integer with a leading digit nonzero.
-%NX is like %X, but takes up at least N positions.
+A field width N is an unsigned decimal integer with a leading digit
+nonzero.  %NX is like %X, but takes up at least N positions.  The
+field width is (on most systems) in bytes, not characters, so it
+depends on the locale what the width (in characters) %NX will end up
+being.
 
 The modifiers are:
 


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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