NAME

Unicode::Security - Unicode security mechanisms

SYNOPSIS

use Unicode::Security qw(confusable restriction_level);

$truth = confusable($string1, $string2);
$truth = whole_script_confusable($script, $string);
$truth = mixed_script_confusable($string);
$truth = mixed_script($string);
$truth = mixed_number($digits);
$level = restriction_level($string);

DESCRIPTION

Implements the Unicode security mechanisms as described in the Unicode Technical Standard #39.

FUNCTIONS

confusable

$truth = confusable($string1 [, $string2])

Returns true if the two strings are visually confusable.

whole_script_confusable

ws_confusable

$truth = whole_script_confusable($script, $string)

Returns true if the string is whole-script confusable within the given script. Returns undef if the string contains multiple scripts.

mixed_script_confusable

ms_confusable

$truth = mixed_script_confusable($string)

Returns true if the string is mixed-script confusable.

skeleton

$skel = skeleton($string)

The skeleton transform is used internally by the confusable algorithm. The result is not intended for display, storage or transmission. It should be thought of as an intermediate processing form, similar to a hashcode. The characters in the skeleton are not guaranteed to be identifier characters.

restriction_level

$level = restriction_level($string [, $non_id_regex])

Returns the restriction level (0-5) of the string. The default Identifier Profile matches against \P{ID_Continue}. If you want to use a different Identifier Profile, you can pass in an optional regular expression to test for non-identifier characters.

soss

%soss = soss($string)

The set of Unicode character script names for a given string. Used internally by the restriction level algorithm.

mixed_script

$truth = mixed_script($string)

Returns true if the string contains mixed scripts.

mixed_number

$truth = mixed_number($digits)

Returns true if the string is composed of characters from different decimal number systems. Returns undef if the string contains characters other than decimal numbers.

SEE ALSO

http://www.unicode.org/reports/tr39/

REQUESTS AND BUGS

Please report any bugs or feature requests to http://rt.cpan.org/Public/Bug/Report.html?Queue=Unicode-Security. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Unicode::Security

You can also look for information at:

COPYRIGHT AND LICENSE

Copyright (C) 2014 gray <gray at cpan.org>, all rights reserved.

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

AUTHOR

gray, <gray at cpan.org>