-
-
22 Nov 2017 02:31:11 UTC
- Distribution: Text-VisualWidth-PP
- Module version: 0.05
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (5947 / 776 / 2)
- Kwalitee
Bus factor: 1- 80.72% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity
24 month- Tools
- Download (11.23KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 4 contributors- Tokuhiro Matsuno <tokuhirom AAJKLFJEF GMAIL COM>
-
Neil Bowers
-
Kaz Utashiro
-
Tokuhiro Matsuno
NAME
Text::VisualWidth::PP - trimming text by the number of the column s of terminals and mobile phones.
SYNOPSIS
use utf8; use Text::VisualWidth::PP; Text::VisualWidth::PP::width("あいうえおaiu"); # => 13 Text::VisualWidth::PP::trim("あいうえおaiu", 7); # => "あいう" # with exporter use Text::VisualWidth::PP qw(vwidth vtrim); vwidth("あいうえおaiu"); # => 13 vtrim("あいうえおaiu", 7); # => "あいう"
DESCRIPTION
This module provides functions to treat half-width and full-width characters and display correct size of text in one line on terminals and mobile phones. You can know the visual width of any text and truncate text by the visual width. Now this module support flagged UTF-8 and tested only with Japanese.
This module is pure perl version of Text::VisualWidth. This is bit slow, but it's not require compiler.
Ambiguous Characters
This module treats ambiguous characters are half width by default.
And you can specify the behavior by the
$Text::VisualWidth::PP::EastAsian
flag expressly.Note: If
$Unicode::EastAsianWidth::EastAsian
is true on compilation time, this module set$Text::VisualWidth::PP::EastAsian
as true for backward compatibility.If you want to detect the ambw parameter from users' environment, please look Unicode::EastAsianWidth::Detect.
AUTHOR
Tokuhiro Matsuno <tokuhirom AAJKLFJEF GMAIL COM>
SEE ALSO
LICENSE
Copyright (C) Tokuhiro Matsuno
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Text::VisualWidth::PP, copy and paste the appropriate command in to your terminal.
cpanm Text::VisualWidth::PP
perl -MCPAN -e shell install Text::VisualWidth::PP
For more information on module installation, please visit the detailed CPAN module installation guide.