From 29d3bea6754640ffe4ed735caafa7f497623142d Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 26 Apr 2015 07:34:24 +0200 Subject: [PATCH] Remove all Encode::decode_utf8 calls, as seemingly scalars from PostgreSQL comes already as UTF-8 in jessie. --- perl/Sesse/pr0n/Common.pm | 2 +- perl/Sesse/pr0n/Index.pm | 4 ++-- perl/Sesse/pr0n/Listing.pm | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index 63190b1..1cd6504 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -96,7 +96,7 @@ sub header { $quote = LWP::Simple::get("http://itk.samfundet.no/include/quotes.cli.php"); $quote = "Error: Could not fetch quotes." if (!defined($quote)); } - Sesse::pr0n::Templates::print_template($r, "header", { title => $title, quotes => Encode::decode_utf8($quote) }); + Sesse::pr0n::Templates::print_template($r, "header", { title => $title, quotes => $quote }); } sub footer { diff --git a/perl/Sesse/pr0n/Index.pm b/perl/Sesse/pr0n/Index.pm index 22d233b..1a631eb 100644 --- a/perl/Sesse/pr0n/Index.pm +++ b/perl/Sesse/pr0n/Index.pm @@ -164,8 +164,8 @@ sub handler { undef, $r->get_server_name, $event) or error($r, "Could not find event $event", 404, "File not found"); - $date = HTML::Entities::encode_entities(Encode::decode_utf8($ref->{'date'})); - $name = HTML::Entities::encode_entities(Encode::decode_utf8($ref->{'name'})); + $date = HTML::Entities::encode_entities($ref->{'date'}); + $name = HTML::Entities::encode_entities($ref->{'name'}); $r->set_last_modified($ref->{'last_update'}); } diff --git a/perl/Sesse/pr0n/Listing.pm b/perl/Sesse/pr0n/Listing.pm index 2cb1125..c8f93f2 100644 --- a/perl/Sesse/pr0n/Listing.pm +++ b/perl/Sesse/pr0n/Listing.pm @@ -48,7 +48,7 @@ sub handler { my $cloud = HTML::TagCloud->new; while (my $ref = $q->fetchrow_hashref()) { - my $tag = Encode::decode_utf8($ref->{'tag'}); + my $tag = $ref->{'tag'}; my $html = HTML::Entities::encode_entities($tag); # is this right? my $uri = Sesse::pr0n::Common::pretty_escape($tag); # and this? @@ -86,8 +86,8 @@ sub handler { while (my $ref = $q->fetchrow_hashref()) { my $id = $ref->{'event'}; - my $date = HTML::Entities::encode_entities(Encode::decode_utf8($ref->{'date'})); - my $name = HTML::Entities::encode_entities(Encode::decode_utf8($ref->{'name'})); + my $date = HTML::Entities::encode_entities($ref->{'date'}); + my $name = HTML::Entities::encode_entities($ref->{'name'}); $r->print("
  • $name ($date)
  • \n"); } -- 2.39.2