Encode::UTF8::Slow - A pure Perl, naive UTF-8 encoder/decoder
use Encode::UTF8::Slow qw/bytes_to_codepoint codepoint_to_bytes/; my $bytes = codepoint_to_bytes(0x1F4FA); #television my $codepoint = bytes_to_codepoint('🗼');
Takes a Unicode codepoint number and returns a scalar of UTF-8 encoded bytes for it. Exported on request.
Takes UTF-8 encoded bytes in a scalar and returns the Unicode codepoint for it. Exported on request.
This is a naive encoder - it doesn't handle UTF-16 pairs, BOM or other noncharacters like 0xFFFE. It's also very slow!
Unicode::UTF8 for a super fast UTF-8 encoder.
Building a UTF-8 encoder in Perl my PerlTricks.com article about this code.
RFC 3629 - which defines the current UTF-8 standard.
This code is hosted at GitHub.
© 2016 David Farrell
FreeBSD, see LICENSE.
To install Encode::UTF8::Slow, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Encode::UTF8::Slow
CPAN shell
perl -MCPAN -e shell install Encode::UTF8::Slow
For more information on module installation, please visit the detailed CPAN module installation guide.