summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2010-06-12 16:54:40 -0400
committerJason Woodward2010-06-12 16:54:40 -0400
commit41d86a31c8f4a3b30d2d3010766e08affade6320 (patch)
treefc6001606b58e58a5d44583e4af999832a21cf5d
parent0cd1c7bacae53a3109d363deac94a30b4e4bebbd (diff)
downloadJaos-WebApp-41d86a31c8f4a3b30d2d3010766e08affade6320.tar.gz
encode render output
-rw-r--r--Changes3
-rw-r--r--lib/Jaos/WebApp/Render/RSS.pm3
-rw-r--r--lib/Jaos/WebApp/Render/TT.pm3
-rw-r--r--lib/Jaos/WebApp/Render/Text.pm3
4 files changed, 8 insertions, 4 deletions
diff --git a/Changes b/Changes
index 7203f0b..38baaa9 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
-0.3 June 11, 2010
+0.3 June 12, 2010
+ * encode render output
* run post post_dispatch hooks in reverse order
* added ::Render::Data
* properly report plugin register failure
diff --git a/lib/Jaos/WebApp/Render/RSS.pm b/lib/Jaos/WebApp/Render/RSS.pm
index e3d4a07..38bbb62 100644
--- a/lib/Jaos/WebApp/Render/RSS.pm
+++ b/lib/Jaos/WebApp/Render/RSS.pm
@@ -2,6 +2,7 @@ package Jaos::WebApp::Render::RSS;
use strict;
use warnings;
use XML::RSS;
+use Encode;
sub register
{
@@ -29,7 +30,7 @@ sub register
}
$controller->app->res->content_type('text/xml');
- $controller->app->res->body($obj->as_string);
+ $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 9b0a435..54d3897 100644
--- a/lib/Jaos/WebApp/Render/TT.pm
+++ b/lib/Jaos/WebApp/Render/TT.pm
@@ -3,6 +3,7 @@ use strict;
use warnings;
use Template ();
use File::Path ();
+use Encode;
sub register
@@ -29,7 +30,7 @@ sub register
\$output
) or die "$@";
$controller->app->res->content_type('text/html');
- $controller->app->res->body($output);
+ $controller->app->res->body(Encode::encode('utf-8',$output));
}
);
diff --git a/lib/Jaos/WebApp/Render/Text.pm b/lib/Jaos/WebApp/Render/Text.pm
index b6ef759..5c8e559 100644
--- a/lib/Jaos/WebApp/Render/Text.pm
+++ b/lib/Jaos/WebApp/Render/Text.pm
@@ -1,6 +1,7 @@
package Jaos::WebApp::Render::Text;
use strict;
use warnings;
+use Encode;
sub register
{
@@ -10,7 +11,7 @@ sub register
text => sub {
my ($controller, $data, %options) = @_;
$controller->app->res->content_type('text/plain');
- $controller->app->res->body($data);
+ $controller->app->res->body(Encode::encode('utf-8',$data));
}
);
}