From: Steinar H. Gunderson Date: Sun, 26 Apr 2015 05:34:24 +0000 (+0200) Subject: Remove all Encode::decode_utf8 calls, as seemingly scalars from PostgreSQL comes... X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=29d3bea6754640ffe4ed735caafa7f497623142d;hp=060aaacf0d15a03ed7287cf81169f630a1a1f95b Remove all Encode::decode_utf8 calls, as seemingly scalars from PostgreSQL comes already as UTF-8 in jessie. --- 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"); }