summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2010-06-27 14:34:14 -0400
committerJason Woodward2010-06-27 14:34:14 -0400
commit02e838c73a288db30af6467d919675976bdf9098 (patch)
tree1ea4c02e55972f8b30fa715d4abe799a8564ed68
parent0f14e1899f054f6e101379207efddac56ad75546 (diff)
downloadJaos-WebApp-02e838c73a288db30af6467d919675976bdf9098.tar.gz
encode json data
-rw-r--r--lib/Jaos/WebApp/Render/JSON.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Jaos/WebApp/Render/JSON.pm b/lib/Jaos/WebApp/Render/JSON.pm
index 79121f5..8ee7268 100644
--- a/lib/Jaos/WebApp/Render/JSON.pm
+++ b/lib/Jaos/WebApp/Render/JSON.pm
@@ -2,6 +2,7 @@ package Jaos::WebApp::Render::JSON;
use strict;
use warnings;
use JSON ();
+use Encode;
sub register
{
@@ -13,7 +14,7 @@ sub register
json => sub {
my ($controller, $data, %options) = @_;
$controller->app->res->content_type('text/x-json');
- $controller->app->res->body($json->encode($data));
+ $controller->app->res->body(Encode::encode('utf-8',$json->encode($data)));
}
);
}