19 Mar 2022 05:32:11 UTC
- Distribution: Unicode-Char
- Module version: 0.03
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (317 / 29 / 0)
- KwaliteeBus factor: 1
- 85.85% Coverage
- License: unknown
- Activity24 month
- Download (3.95KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionDANKOGAI Dan Kogaiand 1 contributors
- Dan Kogai
Unicode::Char - OO interface to charnames and others
use Unicode::Char; my $u = Unicode::Char->new(); # prints "KOGAI Dan" in Kanji print $u->u5c0f, $u->u98fc, $u->u5f3e, "\n"; # smiley here print $u->white_smiling_face, $u->black_smiling_face, "\n";
This module provides OO interface to Unicode characters.
Returns a character whose Unicode Number is the argument.
$u->u('5c0f'); # "small" in Kanji
But the following is handier.
$u->u5c0f; # same thing but as a method
These methods are generatated on demand.
Returns a character whose Unicode Canonical Name is the argument.
$u->n('white smiling face');
$u->u(), you may prefer the handier version:
As you many have noticed, these names do not have to be all in caps. Just replace spaces with underscore.
Returns the Unicode Canonical Name of the character.;
my $name = $u->name(chr(0x263A)); # WHITE SMILING FACE
Same as above but in list context.
my @names = $u->names("perl"); # ('LATIN SMALL LETTER P', # 'LATIN SMALL LETTER E', # 'LATIN SMALL LETTER R', # 'LATIN SMALL LETTER L')
Dan Kogai, <email@example.com>
Copyright (C) 2006-2022 by Dan Kogai
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
Module Install Instructions
To install Unicode::Char, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Unicode::Char
For more information on module installation, please visit the detailed CPAN module installation guide.