Revision history for Perl extension Catalyst::View::TT.
+0.42 2014-12-29
+ - Fixes to test cases to be compatible with Catalyst v5.90080
+
0.41 2013-02-28
- New local attribute to let you override the default content type when
no content type has been set for the response.
use MRO::Compat;
use Scalar::Util qw/blessed weaken/;
-our $VERSION = '0.41';
+our $VERSION = '0.42';
$VERSION = eval $VERSION;
__PACKAGE__->mk_accessors('template');
}
unless ( $c->response->content_type ) {
- my $default = $self->content_type || 'text/html; charset=utf-8';
+ my $default = $self->content_type || 'text/html; charset=UTF-8';
$c->response->content_type($default);
}
=head2 Unicode
+B<NOTE> Starting with L<Catalyst> v5.90080 unicode and encoding has been
+baked into core, and the default encoding is UTF-8. The following advice
+is for older versions of L<Catalyst>
+
Be sure to set C<< ENCODING => 'utf-8' >> and use
L<Catalyst::Plugin::Unicode::Encoding> if you want to use non-ascii
characters (encoded as utf-8) in your templates.
use lib "$FindBin::Bin/lib";
use_ok('Catalyst::Test', 'TestApp');
-is(request("/test_alt_content_type")->header('Content-Type'), 'text/plain');
+# Hack to support Catalyst v5.90080+ (JNAP)
+if(TestApp->can('encoding') and (my $enc = TestApp->encoding) and TestApp->can('clear_encoding')) {
+ is(request("/test_alt_content_type")->header('Content-Type'), "text/plain; charset=${\$enc->mime_name}", "Plain text with ${\$enc->mime_name}");
+} else {
+ is(request("/test_alt_content_type")->header('Content-Type'), 'text/plain', 'Plain Text');
+}
done_testing;