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: Eli Zaretskii
Subject: bug#20258: 24.5; format-time-string miscounting of multibyte characters
Date: Mon, 30 Sep 2019 10:01:17 +0300

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Mon, 30 Sep 2019 05:09:08 +0200
> Cc: stefan@marxist.se, gunnar.horrigmo@usit.uio.no
> 
> 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.
> ---
> 
> But the natural interpretation of "positions" isn't bytes, I think, and
> if is, then the doc string should say so.
> 
> (let ((system-time-locale "nb_NO.UTF-8"))
>   (format-time-string "%6a" (date-to-time "Sat Apr  4 16:14:40 2015")))
> => "  lø."
> 
> (if you have that locale in /etc/locale.gen.)
> 
> But I seem to remember from previous discussions that this quirk is in
> the C strftime function?  And Emacs just call it?

Yes, that's true.

> So I think what WIDTH means should be said explicitly in the doc string.

It can only warn that WIDTH _might_ be measured in bytes, since the
underlying implementation of strftime just might DTRT.  Or not.

I think this should be raised as a bug to glibc developers, as their
documentation says "characters", according to my reading.





reply via email to

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