Text::VisualPrintf - printf family functions to handle Non-ASCII characters
use Text::VisualPrintf; Text::VisualPrintf::printf FORMAT, LIST Text::VisualPrintf::sprintf FORMAT, LIST use Text::VisualPrintf qw(vprintf vsprintf); vprintf FORMAT, LIST vsprintf FORMAT, LIST
Version 3.09
Text::VisualPrintf is a almost-printf-compatible library with a capability of handling multi-byte wide characters properly.
When the given string is truncated by the maximum precision, space character is padded if the wide character does not fit to the remained space.
Use just like perl's printf and sprintf functions except that printf does not take FILEHANDLE.
Take a look at an experimental Text::VisualPrintf::IO if you want to work with FILEHANDLE and printf.
Text::VisualPrintf::IO
Hold a function pointer to calculate visual width of given string. Default function is Text::VisualWidth::PP::width.
Text::VisualWidth::PP::width
Strings in the LIST which contains wide-width character are replaced before formatting, and recovered after the process.
Unique replacement string contains combinations of two ASCII characters not found in the format string and all parameters. If two characters are not available, function behaves just like a standard one.
Text::VisualPrintf, Text::VisualPrintf::IO
https://github.com/kaz-utashiro/Text-VisualPrintf
Text::ANSI::Printf
Kazumasa Utashiro
Copyright 2011-2020 Kazumasa Utashiro.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Text::VisualPrintf, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::VisualPrintf
CPAN shell
perl -MCPAN -e shell install Text::VisualPrintf
For more information on module installation, please visit the detailed CPAN module installation guide.