'strftime' and 'strptime' honor the locale encoding.
authorLudovic Courtès <ludo@gnu.org>
Sun, 30 Jun 2019 19:31:36 +0000 (21:31 +0200)
committerLudovic Courtès <ludo@gnu.org>
Sun, 30 Jun 2019 19:31:36 +0000 (21:31 +0200)
commitab2fd70ef1e36c6532128b73082809ef3c056556
tree0c2e94ba20d85d670271fc805956ea6b49408680
parent63f54a7bc6adbc0f1b397872fb7eb96e84967ff1
'strftime' and 'strptime' honor the locale encoding.

Fixes <https://bugs.gnu.org/35920>.
Reported by Christopher Lam <christopher.lck@gmail.com>.

* libguile/stime.c (scm_strftime): Use 'scm_to_locale_stringn' instead
of 'scm_to_utf8_stringn'.
(scm_strptime): Likewise, and use 'scm_string_length' instead of
'u8_strnlen'.
* test-suite/tests/time.test ("strftime")["strftime passes wide
characters"]: Wrap body in 'with-locale'.
["strftime fr_FR.utf8", "strftime fr_FR.iso88591"]: New tests.
("strptime")["strftime fr_FR.utf8", "strftime fr_FR.iso88591"]: New
tests.
libguile/stime.c
test-suite/tests/time.test