From 19950f85c62cc7f4cdcec70cf1d751780a9ebcdd Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 22 Nov 2016 17:38:58 +0000 Subject: Don't double-decode strftime output. As with d3d0ab6d, we need to only decode_utf8 strftime output that has not already been decoded, to prevent errors in Perl 5.20+. --- perllib/Utils.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/perllib/Utils.pm b/perllib/Utils.pm index 84c09d09d..7dd2a3f39 100644 --- a/perllib/Utils.pm +++ b/perllib/Utils.pm @@ -178,16 +178,17 @@ sub prettify_dt { } $tt .= ', ' unless $type eq 'date'; if ($dt->strftime('%Y %U') eq $now->strftime('%Y %U')) { - $tt .= decode_utf8($dt->strftime('%A')); + $tt .= $dt->strftime('%A'); } elsif ($type eq 'zurich') { - $tt .= decode_utf8($dt->strftime('%e. %B %Y')); + $tt .= $dt->strftime('%e. %B %Y'); } elsif ($type eq 'short') { - $tt .= decode_utf8($dt->strftime('%e %b %Y')); + $tt .= $dt->strftime('%e %b %Y'); } elsif ($dt->strftime('%Y') eq $now->strftime('%Y')) { - $tt .= decode_utf8($dt->strftime('%A %e %B %Y')); + $tt .= $dt->strftime('%A %e %B %Y'); } else { - $tt .= decode_utf8($dt->strftime('%a %e %B %Y')); + $tt .= $dt->strftime('%a %e %B %Y'); } + $tt = decode_utf8($tt) if !utf8::is_utf8($tt); return $tt; } -- cgit v1.2.3