[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#20258: 24.5; format-time-string miscounting of multibyte characters
From: |
Stefan Kangas |
Subject: |
bug#20258: 24.5; format-time-string miscounting of multibyte characters |
Date: |
Mon, 30 Sep 2019 02:35:08 +0200 |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Gunnar Horrigmo <gunnar.horrigmo@usit.uio.no>
>> Date: Sat, 04 Apr 2015 16:33:50 +0200
>>
>>
>> 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ø."
>>
>> (length (format-time-string "%6a" (date-to-time "Sat Apr 4 16:14:40 2015")))
>> 5
>
> 'length' counts characters, not bytes. If you need to count bytes,
> use 'string-bytes' instead:
>
> (string-bytes " lø.") => 6
I can see no bug here, only a misunderstanding about the length
function. I'm therefore closing this bug. If that's incorrect, please
reopen this bug report.
Best regards,
Stefan Kangas
- bug#20258: 24.5; format-time-string miscounting of multibyte characters,
Stefan Kangas <=
- bug#20258: 24.5; format-time-string miscounting of multibyte characters, Lars Ingebrigtsen, 2019/09/29
- bug#20258: 24.5; format-time-string miscounting of multibyte characters, Eli Zaretskii, 2019/09/30
- bug#20258: 24.5; format-time-string miscounting of multibyte characters, Andreas Schwab, 2019/09/30
- bug#20258: 24.5; format-time-string miscounting of multibyte characters, Eli Zaretskii, 2019/09/30
- bug#20258: 24.5; format-time-string miscounting of multibyte characters, Lars Ingebrigtsen, 2019/09/30
- bug#20258: 24.5; format-time-string miscounting of multibyte characters, Eli Zaretskii, 2019/09/30
- bug#20258: 24.5; format-time-string miscounting of multibyte characters, Lars Ingebrigtsen, 2019/09/30
- bug#20258: 24.5; format-time-string miscounting of multibyte characters, Gunnar Horrigmo, 2019/09/30
- bug#20258: 24.5; format-time-string miscounting of multibyte characters, Eli Zaretskii, 2019/09/30
- bug#20258: 24.5; format-time-string miscounting of multibyte characters, Eli Zaretskii, 2019/09/30