NAME

String::UTF8 - Determine whether a string consists of well-formed UTF-8 byte sequences

SYNOPSIS

use String::UTF8 qw[:all];

$boolean = is_utf8($string);
$boolean = is_utf8($string, UTF8_DISALLOW_NONCHARACTERS);

DESCRIPTION

Determine whether a string consists of well-formed UTF-8 byte sequences.

FUNCTIONS

is_utf8

Determine whether $string consists of well-formed UTF-8 byte sequences.

Usage

$boolean = is_utf8($string);
$boolean = is_uft8($string, $flags);

Arguments

$string
$flags (optional)

Returns

$boolean

Note

This function ignores Perl's internal UTF-8 flag (SVf_UTF8) and simply checks the content of the string.

CONSTANTS

FLAGS

UTF8_DISALLOW_NONCHARACTERS

If this flag is set, noncharacters is not considered well-formed.

EXPORT

None by default. Functions and constants can either be imported individually or in sets grouped by tag names. The tag names are:

:all exports all functions and constants.

DIAGNOSTICS

(F) Usage: %s

Subroutine %s invoked with wrong number of arguments.

ENVIRONMENT

Set the environment variable STRING_UTF8_PP to a true value before loading this package to disable usage of XS implementation.

PREREQUISITES

Run-Time

perl 5.006 or greater.
Carp, core module.
Exporter, core module.

Build-Time

In addition to Run-Time:

Test::More 0.47 or greater, core module since 5.6.2.
Test::Exception.

SEE ALSO

String::UTF8::XS

AUTHOR

Christian Hansen, <chansen@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2009 by Christian Hansen

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.