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
Returns
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:
DIAGNOSTICS
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
Build-Time
In addition to Run-Time:
- Test::More 0.47 or greater, core module since 5.6.2.
- Test::Exception.
SEE ALSO
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.