Control: tags 869240 + pending On Fri, 21 Jul 2017 at 23:48:36 +0300, Alexander Galanin wrote: > > Cannot decode string with wide characters at > > /usr/lib/x86_64-linux-gnu/perl/5.24/Encode.pm line 202. > > I think that the real problem is double-decoding of strftime() result > that is already a proper widestring. See IkiWiki.pm at line 1300: > > > Encode::decode($strftime_encoding, POSIX::strftime(@_))
This decoding used to be necessary (<http://www.perlmonks.org/?node_id=857018>) so we probably can't just drop it. It appears to have become (at least conditionally) unnecessary in Perl 5.21.1, commit <https://perl5.git.perl.org/perl.git/commit/9717af6>. What we *can* do is to test the result of calling Encode::is_utf8() on the result, and only decode it if it isn't already a wide string, like safe_decode_utf8 in IkiWiki::CGI. Done in <http://source.ikiwiki.branchable.com/?p=source.git;a=commit;h=3789b385b210bd8fdfa755a0ca435c11fa53290e>. Please try that patch; I did a quick test in the ru_RU.utf8 locale, and it seemed to fail as you describe without the patch but work with it. Regards, S