From: John Napiorkowski Date: Mon, 29 Dec 2014 19:36:28 +0000 (-0600) Subject: update for newer catalyst unicode changes X-Git-Tag: 0.42^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=93c63aff864556215576bac8da1332e90cd7d6cb;p=catagits%2FCatalyst-View-TT.git update for newer catalyst unicode changes --- diff --git a/Changes b/Changes index e096a60..20ed68e 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,8 @@ Revision history for Perl extension Catalyst::View::TT. 0.42 2014-12-29 - Fixes to test cases to be compatible with Catalyst v5.90080 + - Added a Unicode test designed to check new Catalyst function + - Docs for above 0.41 2013-02-28 - New local attribute to let you override the default content type when diff --git a/Makefile.PL b/Makefile.PL index 01cb6f7..2d42524 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -17,6 +17,7 @@ requires 'Path::Class' => 0; requires 'MRO::Compat' => 0; test_requires 'Test::More'; +test_requires 'File::Spec'; auto_install; resources repository => 'git://git.shadowcat.co.uk/catagits/Catalyst-View-TT.git'; diff --git a/lib/Catalyst/View/TT.pm b/lib/Catalyst/View/TT.pm index 39725f9..db72b25 100644 --- a/lib/Catalyst/View/TT.pm +++ b/lib/Catalyst/View/TT.pm @@ -453,15 +453,42 @@ If you are calling C directly then you can specify dynamic paths by having a C key with a value of additional directories to search. See L for an example showing this. -=head2 Unicode +=head2 Unicode (pre Catalyst v5.90080) B Starting with L 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 +is for older versions of L. Be sure to set C<< ENCODING => 'utf-8' >> and use L if you want to use non-ascii -characters (encoded as utf-8) in your templates. +characters (encoded as utf-8) in your templates. This is only needed if +you actually have UTF8 literals in your templates and the BOM is not +properly set. Setting encoding here does not magically encode your +template output. If you are using this version of L you need +to all the Unicode plugin, or upgrade (preferred) + +=head2 Unicode (Catalyst v5.90080+) + +This version of L will automatically encode your body output +to UTF8. This means if your variables contain multibyte characters you don't +need top do anything else to get UTF8 output. B if your templates +contain UTF8 literals (like, multibyte characters actually in the template +text), then you do need to either set the BOM mark on the template file or +instruct TT to decode the templates at load time via the ENCODING configuration +setting. Most of the time you can just do: + + MyApp::View::HTML->config( + ENCODING => 'UTF-8'); + +and that will just take care of everything. This configuration setting will +force L