Types::Encodings - type constraints for Bytes and Chars
Additional type constraints and coercions to complement Types::Standard.
Str
Alias for Types::Standard type constraint of the same name.
Bytes
Strings where utf8::is_utf8() is false.
utf8::is_utf8()
Chars
Strings where either utf8::is_utf8() is true, or each byte is below 0x7F.
0x7F
Encode[`a]
Coercion to encode a character string to a byte string using Encode::encode(). This is a parameterized type coercion, which expects a character set:
Encode::encode()
use Types::Standard qw( Bytes Encode ); has filename => ( is => "ro", isa => Bytes->plus_coercions( Encode["utf-8"] ), coerce => 1, );
Decode[`a]
Coercion to decode a byte string to a character string using Encode::decode(). This is a parameterized type coercion, which expects a character set.
Encode::decode()
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=Types-Encodings.
Types::Standard.
Toby Inkster <tobyink@cpan.org>.
This software is copyright (c) 2013-2014, 2019 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install Types::Encodings, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Types::Encodings
CPAN shell
perl -MCPAN -e shell install Types::Encodings
For more information on module installation, please visit the detailed CPAN module installation guide.