Unicode::Block::Item - Class for unicode block character.
use Unicode::Block::Item; my $obj = Unicode::Block::Item->new(%parameters); my $base = $obj->base; my $char = $obj->char; my $hex = $obj->hex; my $last_hex = $obj->last_hex; my $width = $obj->width;
new(%parameters)
Constructor.
hex
Hexadecimal number. Default value is undef. It is required.
hex_length
Length of hex number. It's used for formatting of hex() method output. Default value is 4.
base()
Get hex base number in format 'U+???x'. Example: 'hex' => 1234h; Returns 'U+123x'. Returns string with hex base number.
char()
Get character. Example: 'hex' => 1234h; Returns 'ሴ'. Returns string with character.
hex()
Get hex number in 'hex_length' length. Example: 'hex' => 1234h; Returns '0x1234'. Returns string with hex number.
last_hex()
Get last hex number. Example: 'hex' => 1234h; Returns '4'. Returns string with last hex number.
width()
Get character width. Returns string with width.
new(): Parameter 'hex' is required. Parameter 'hex' isn't hexadecimal number. From Class::Utils::set_params(): Unknown parameter '%s'.
use strict; use warnings; use Encode qw(encode_utf8); use Unicode::Block::Item; # Object. my $obj = Unicode::Block::Item->new( 'hex' => 2505, ); # Print out. print 'Character: '.encode_utf8($obj->char)."\n"; print 'Hex: '.$obj->hex."\n"; print 'Last hex character: '.$obj->last_hex."\n"; print 'Base: '.$obj->base."\n"; # Output. # Character: ┅ # Hex: 2505 # Last hex character: 5 # Base: U+250x
Class::Utils, Error::Pure, Readonly, Text::CharWidth, Unicode::Char.
Class for unicode block manipulation.
https://github.com/tupinek/Unicode-Block
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2013-2017 Michal Josef Špaček BSD 2-Clause License
0.07
To install Unicode::Block, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Unicode::Block
CPAN shell
perl -MCPAN -e shell install Unicode::Block
For more information on module installation, please visit the detailed CPAN module installation guide.