NAME
Encode::UTF8::Slow - A pure Perl, naive UTF-8 encoder/decoder
SYNOPSIS
use Encode::UTF8::Slow qw/bytes_to_codepoint codepoint_to_bytes/;
my $bytes = codepoint_to_bytes(0x1F4FA); #television
my $codepoint = bytes_to_codepoint('🗼');
FUNCTIONS
codepoint_to_bytes
Takes a Unicode codepoint number and returns a scalar of UTF-8 encoded bytes for it. Exported on request.
bytes_to_codepoint
Takes UTF-8 encoded bytes in a scalar and returns the Unicode codepoint for it. Exported on request.
WARNING
This is a naive encoder - it doesn't handle UTF-16 pairs, BOM or other noncharacters like 0xFFFE. It's also very slow!
SEE ALSO
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.
REPOSITORY
This code is hosted at GitHub.
AUTHOR
© 2016 David Farrell
LICENSE
FreeBSD, see LICENSE.