| Template-Plugin-UTF8Decode documentation | Contained in the Template-Plugin-UTF8Decode distribution. |
Template::Plugin::UTF8Decode - UTF8 decoder filter for Template Toolkit
[% USE UTF8Decode %] [% ansi_string_var | utf8_decode | html_entity %]
This module is a Template Toolkit filter, which decode a string to utf8. For example, using FreeTDS (http://www.freetds.org) in order to talk with ms sql, can return an utf8 string as byte char.
Installs the filter as 'utf8_decode'.
Receives a reference to the plugin object, along with the text to be filtered.
Fabio Masini <fabio.masini@gmail.com>
Copyright (C) 2009 Fabio Masini
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Template-Plugin-UTF8Decode documentation | Contained in the Template-Plugin-UTF8Decode distribution. |
package Template::Plugin::UTF8Decode; use 5.006; use strict; our $VERSION = '0.01'; my $FILTER_NAME = 'utf8_decode'; use Template::Plugin::Filter; use base qw( Template::Plugin::Filter ); sub init { my $self = shift; $self->install_filter($FILTER_NAME); return $self; } sub filter { my ($self, $text) = @_; utf8::decode($text); return $text; } 1; __END__