https://github.com/dnmfarrell/encode-utf8-slow
A naive UTF-8 encoder/decoder written in Perl
https://github.com/dnmfarrell/encode-utf8-slow
Last synced: 8 months ago
JSON representation
A naive UTF-8 encoder/decoder written in Perl
- Host: GitHub
- URL: https://github.com/dnmfarrell/encode-utf8-slow
- Owner: dnmfarrell
- License: other
- Created: 2016-08-02T13:10:32.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-10-06T14:35:53.000Z (over 7 years ago)
- Last Synced: 2025-01-16T16:49:12.783Z (over 1 year ago)
- Language: Perl
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.pod
- License: LICENSE
Awesome Lists containing this project
README
=encoding utf8
=head1 NAME
Encode::UTF8::Slow - A pure Perl, naive UTF-8 encoder/decoder
=head1 SYNOPSIS
use Encode::UTF8::Slow qw/bytes_to_codepoint codepoint_to_bytes/;
my $bytes = codepoint_to_bytes(0x1F4FA); #television
my $codepoint = bytes_to_codepoint('🗼');
=head1 FUNCTIONS
=head2 codepoint_to_bytes
Takes a Unicode codepoint number and returns a scalar of UTF-8 encoded bytes
for it. Exported on request.
=head2 bytes_to_codepoint
Takes UTF-8 encoded bytes in a scalar and returns the Unicode codepoint for it.
Exported on request.
=head1 WARNING
This is a naive encoder - it doesn't handle UTF-16 pairs, BOM or other
noncharacters like 0xFFFE. It's also very slow!
=head1 SEE ALSO
=over 4
=item *
L for a super fast UTF-8 encoder.
=item *
L my PerlTricks.com article about this code.
=item *
L - which defines the current UTF-8 standard.
=back
=head1 REPOSITORY
This code is hosted at L.
=head1 AUTHOR
E 2016 David Farrell
=head1 LICENSE
FreeBSD, see LICENSE.
=cut