Name
SPVM::Unicode::Normalize - Normalizing UTF-8
Description
The Unicode::Normalize class in SPVM has methods to normalize UTF-8.
Usage
use Unicode::Normalize;
my $NFD_string = Unicode::Normalize->NFD($string);
my $NFC_string = Unicode::Normalize->NFC($string);
my $NFKD_string = Unicode::Normalize->NFKD($string);
my $NFKC_string = Unicode::Normalize->NFKC($string);
Class Methods
NFC
static method NFC : string ($string : string);
Returns the Normalization Form C (formed by canonical decomposition followed by canonical composition).
This method calls native utf8proc_map
function defined in ut8proc.h
of utf8proc library.
Exceptions:
The string $string must be defined. Otherwise an exception is thrown.
If utf8proc_map failed, an exception is thrown.
NFD
static method NFD : string ($string : string);
Returns the Normalization Form D (formed by canonical decomposition).
This method calls native utf8proc_map
function defined in ut8proc.h
of utf8proc library.
Exceptions:
The string $string must be defined. Otherwise an exception is thrown.
If utf8proc_map failed, an exception is thrown.
NFKC
static method NFKC : string ($string : string);
Returns the Normalization Form KC (formed by compatibility decomposition followed by canonical composition).
This method calls native utf8proc_map
function defined in ut8proc.h
of utf8proc library.
Exceptions:
The string $string must be defined. Otherwise an exception is thrown.
If utf8proc_map failed, an exception is thrown.
NFKD
static method NFKD : string ($string : string);
Returns the Normalization Form KD (formed by compatibility decomposition).
This method calls native utf8proc_map
function defined in ut8proc.h
of utf8proc library.
Exceptions:
The string $string must be defined. Otherwise an exception is thrown.
If utf8proc_map failed, an exception is thrown.
See Also
Porting
SPVM::Unicode::Normalize is a Perl's Unicode::Normalize porting to SPVM.
Repository
SPVM::Unicode::Normalize - Github
Author
Yuki Kimoto kimoto.yuki@gmail.com
Copyright & License
Copyright (c) 2023 Yuki Kimoto
MIT License