aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatthew <matthew>2009-09-09 19:15:54 +0000
committermatthew <matthew>2009-09-09 19:15:54 +0000
commitd020b599a3e8be4d9455e8dd5981132b04b2b20c (patch)
tree5e472801924714474a5696ca04a826f0b09d7bcf
parent5f7e9ccf3ace45fc5cd77ae9700843092f327cd0 (diff)
Fix double encoding problem with Welsh category.
-rw-r--r--perllib/Page.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm
index df491957b..cf4335fac 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Page.pm,v 1.174 2009-09-09 15:29:26 louise Exp $
+# $Id: Page.pm,v 1.175 2009-09-09 19:15:54 matthew Exp $
#
package Page;
@@ -702,10 +702,12 @@ sub display_problem_text {
# Display information about problem
$out .= '<p><em>';
if ($q->{site} eq 'emptyhomes') {
+ my $category = _($problem->{category});
+ utf8::decode($category); # So that Welsh to Welsh doesn't encode already-encoded UTF-8
if ($problem->{anonymous}) {
- $out .= sprintf(_('%s, reported anonymously at %s'), ent(_($problem->{category})), prettify_epoch($problem->{time}));
+ $out .= sprintf(_('%s, reported anonymously at %s'), ent($category), prettify_epoch($problem->{time}));
} else {
- $out .= sprintf(_('%s, reported by %s at %s'), ent(_($problem->{category})), ent($problem->{name}), prettify_epoch($problem->{time}));
+ $out .= sprintf(_('%s, reported by %s at %s'), ent($category), ent($problem->{name}), prettify_epoch($problem->{time}));
}
} else {
if ($problem->{service} && $problem->{category} && $problem->{category} ne 'Other' && $problem->{anonymous}) {
@@ -747,7 +749,7 @@ sub display_problem_text {
if ($problem->{photo}) {
my $dims = Image::Size::html_imgsize(\$problem->{photo});
- $out .= "<p align='center'><img alt='' $dims src='/photo?id=$problem->{id}'></p>";
+ $out .= "<p align='center'><img alt='' $dims src='/photo?id=$problem->{id}'></p>";
}
return $out;