The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Template::Plugin::Filter::VisualTruncate - Filter Plugin for trimming text by the number of the columns of terminals and mobile phones.

SYNOPSIS

Supported encodings on this module are UTF8, EUC-JP and system locale.

If your template was written in UTF8, then

    [% USE Filter.VisualTruncate 'utf8' %]
    [% row.comment | visual_truncate(20, '...') | html %]

or EUC-JP

    [% USE Filter.VisualTruncate 'euc-jp' %]
    [% row.comment | visual_truncate(20, '...') | html %]

or system locale

    [% USE Filter.VisualTruncate 'locale' %]
    [% row.comment | visual_truncate(20, '...') | html %]

If parameters are not specified explicitly...

    [% row.comment | visual_truncate() | html %]

default values is used.

    [% row.comment | visual_truncate(32, '...') | html %]

FUNCTIONS

init

    Overrided method. See more detail Template::Plugin::Filter

filter

    Overrided method. See more detail Template::Plugin::Filter

SEE ALSO

HTML::Filters, HTML::Plugin::Filter, Text::VisualWidth, Text::CharWidth

AUTHOR

bokutin, <bokutin at cpan.org>

COPYRIGHT & LICENSE

Copyright 2007 bokutin, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.