Text::ASCIITable::TW - add TW support for Text::ASCIITable


Text-ASCIITable-TW documentation Contained in the Text-ASCIITable-TW distribution.

Index


Code Index:

NAME

Top

Text::ASCIITable::TW - add TW support for Text::ASCIITable

VERSION

Top

Version 0.03

SYNOPSIS

Top

see Text::ASCIITable

AUTHOR

Top

Alec Chen, <alec at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-text-asciitable-tw at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Text-ASCIITable-TW. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Text::ASCIITable::TW

You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Text-ASCIITable-TW

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Text-ASCIITable-TW

* CPAN Ratings

http://cpanratings.perl.org/d/Text-ASCIITable-TW

* Search CPAN

http://search.cpan.org/dist/Text-ASCIITable-TW

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Text-ASCIITable-TW documentation Contained in the Text-ASCIITable-TW distribution.
package Text::ASCIITable::TW;
use Moose;
use Encode qw(encode decode);
extends 'Text::ASCIITable';

use version; our $VERSION = qv('0.03');


override 'new' => sub {
    my $class = shift;
    my $hash_ref = super;
    my $self = bless $hash_ref, $class;
    return $self;
};

before 'align' => sub {
    my $orig_length = length( decode('utf8', $_[1]) );
    my $big5_length = length( encode('big5', decode('utf8', $_[1]) ) );
    my $bias = $big5_length - $orig_length;
    $_[3] += $bias;
};

1; # End of Text::ASCIITable::TW