summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2010-07-09 16:01:29 -0400
committerJason Woodward2010-07-09 16:01:29 -0400
commitfd024d2cc73b0f1a1d35ff206739b96fcb3fe1be (patch)
treed74cbfe305c8ff0b0ffa96e62ed5c9cc73722ca8
parent6fd7a1017eb1aed61f697774fb333a036544ac32 (diff)
downloadJaos-WebApp-fd024d2cc73b0f1a1d35ff206739b96fcb3fe1be.tar.gz
set charset to utf-8 for applicable render content types
-rw-r--r--lib/Jaos/WebApp/Render/JSON.pm2
-rw-r--r--lib/Jaos/WebApp/Render/RSS.pm2
-rw-r--r--lib/Jaos/WebApp/Render/TT.pm2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/Jaos/WebApp/Render/JSON.pm b/lib/Jaos/WebApp/Render/JSON.pm
index 04d7f80..13411fb 100644
--- a/lib/Jaos/WebApp/Render/JSON.pm
+++ b/lib/Jaos/WebApp/Render/JSON.pm
@@ -13,7 +13,7 @@ sub register
$app->add_renderer(
json => sub {
my ($controller, $data, %options) = @_;
- $controller->app->res->content_type('text/x-json');
+ $controller->app->res->content_type('text/x-json; charset=utf-8');
$controller->app->res->body(Encode::encode('utf-8',$json->encode($data)));
}
);
diff --git a/lib/Jaos/WebApp/Render/RSS.pm b/lib/Jaos/WebApp/Render/RSS.pm
index 0302514..9d7826c 100644
--- a/lib/Jaos/WebApp/Render/RSS.pm
+++ b/lib/Jaos/WebApp/Render/RSS.pm
@@ -29,7 +29,7 @@ sub register
$obj->add_item(%$i);
}
- $controller->app->res->content_type('text/xml');
+ $controller->app->res->content_type('text/xml; charset=utf-8');
$controller->app->res->body(Encode::encode('utf-8',$obj->as_string));
}
);
diff --git a/lib/Jaos/WebApp/Render/TT.pm b/lib/Jaos/WebApp/Render/TT.pm
index d882229..6d99d62 100644
--- a/lib/Jaos/WebApp/Render/TT.pm
+++ b/lib/Jaos/WebApp/Render/TT.pm
@@ -29,7 +29,7 @@ sub register
$controller->stash,
\$output
) or die "$@";
- $controller->app->res->content_type('text/html');
+ $controller->app->res->content_type('text/html; charset=utf-8');
$controller->app->res->body(Encode::encode('utf-8',$output));
}
);