[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#20258: 24.5; format-time-string miscounting of multibyte characters
From: |
Andreas Schwab |
Subject: |
bug#20258: 24.5; format-time-string miscounting of multibyte characters |
Date: |
Sat, 04 Apr 2015 18:42:29 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Gunnar Horrigmo <gunnar.horrigmo@usit.uio.no> writes:
> As the subject says, format-time-string miscounts multibyte characters.
> Simple example with nb_NO.utf8 locale, where ø is two bytes:
>
> (format-time-string "%6a" (date-to-time "Sat Apr 4 16:14:40 2015"))
> " lø."
This is a limitation of the underlying strftime, which operates on
bytes, not characters. This could be fixed by using wcsftime instead.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."