I got the following error related to Encode.pm when I build my Ikiwiki instance

$ ikiwiki --setup mysite.setup
'git pull --prune origin' failed:  at /usr/pkg/lib/perl5/vendor_perl/5.20.0/IkiWiki/Plugin/git.pm line 220.
Cannot decode string with wide characters at /usr/pkg/lib/perl5/5.20.0/darwin-thread-multi-2level/Encode.pm line 175.

Any idea how to fix it?

I installed ikiwiki via pkgsrc on OS X 10.10.2:

 $ ikiwiki --version
 ikiwiki version 3.20141016
 $ uname -a
 Darwin qazwsx.local 14.1.0 Darwin Kernel Version 14.1.0: Mon Dec 22 23:10:38 PST 2014; root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64
 $ which perl
 /usr/bin/perl
 $ perl --version

 This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level
 (with 2 registered patches, see perl -V for more detail)
     ...

This sounds like an issue that I hoped we'd already fixed, but Debian bug 776181 points out one other situation where it can happen. Could you try the patch from that bug and see whether that fixes it for you too?

Comment by smcv Thu Jan 29 15:33:23 2015

I manually modified /usr/pkg/lib/perl5/vendor_perl/5.20.0/IkiWiki/CGI.pm removing the three lines

# call decode_utf8 on >= 5.20 only if it's not already decoded,
# otherwise it balks, on < 5.20, always call it
if ($] < 5.02 || !Encode::is_utf8($octets)) {

and adding a new line

if (!Encode::is_utf8($octets)) {

Then I ran ikiwiki --setup mysite.setup and see the following messages:

...
Aborting
'git pull --prune origin' failed:  at /usr/pkg/lib/perl5/vendor_perl/5.20.0/IkiWiki/Plugin/git.pm line 220.
Cannot decode string with wide characters at /usr/pkg/lib/perl5/5.20.0/darwin-thread-multi-2level/Encode.pm line 175.

Any ideas?

Comment by Qi Thu Jan 29 16:07:11 2015