GNU bug report logs - #35920
strftime incorrectly assumes that nstrftime will produce UTF-8

Previous Next

Package: guile;

Reported by: Mark H Weaver <mhw <at> netris.org>

Date: Sun, 26 May 2019 20:45:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#35920: closed (strftime incorrectly assumes that nstrftime
 will produce UTF-8)
Date: Sun, 30 Jun 2019 19:52:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 30 Jun 2019 21:51:42 +0200
with message-id <874l46svg1.fsf <at> gnu.org>
and subject line Re: bug#35920: strftime incorrectly assumes that nstrftime will produce UTF-8
has caused the debbugs.gnu.org bug report #35920,
regarding strftime incorrectly assumes that nstrftime will produce UTF-8
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
35920: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=35920
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mark H Weaver <mhw <at> netris.org>
To: Christopher Lam <christopher.lck <at> gmail.com>
Cc: bug-guile <at> gnu.org
Subject: strftime incorrectly assumes that nstrftime will produce UTF-8
Date: Sun, 26 May 2019 16:41:57 -0400
Hi Christopher,

Christopher Lam <christopher.lck <at> gmail.com> writes:

> Addendum - wish to confirm if guile bug (guile-2.2 on Windows):
> - set locale to non-Anglo so that (setlocale LC_ALL) returns
> "French_France.1252"
> - call (strftime "%B" 4000000) - that's 4x10^6 -- this should return
> "février 1970"
>
> but the following error arises:
> Throw to key `decoding-error' with args `("scm_from_utf8_stringn" "input
> locale conversion error" 0 #vu8(102 233 118 114 105 101 114 32 49 57 55
> 48))'.
>
> Is this a bug?

Yes.  Guile's 'strftime' procedure currently assumes that the underlying
'nstrftime' C function (from Gnulib) will produce output in UTF-8,
although it almost certainly produces output in the locale encoding.
Indeed, the bytevector #vu8(102 233 118 114 105 101 114 32 49 57 55 48)
represents the characters "février 1970" in Windows-1252 encoding.

I'm CC'ing this reply to <bug-guile <at> gnu.org>, so that a bug ticket will
be created.  In the future, that's the preferred address for sending bug
reports.

Anyway, thanks for letting us know about this.  I'll work on it soon.

      Mark


[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Mark H Weaver <mhw <at> netris.org>
Cc: 35920-done <at> debbugs.gnu.org, Christopher Lam <christopher.lck <at> gmail.com>
Subject: Re: bug#35920: strftime incorrectly assumes that nstrftime will
 produce UTF-8
Date: Sun, 30 Jun 2019 21:51:42 +0200
Hi Mark,

Mark H Weaver <mhw <at> netris.org> skribis:

> Here's a patch that might fix the problem, but I don't have time to test
> it right now.

It works! :-)  I wrote tests and pushed it as
ab2fd70ef1e36c6532128b73082809ef3c056556.

I forgot to change the commit author to you before pushing, apologies!

Thanks,
Ludo’.


This bug report was last modified 5 years and 347 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.