-
-
01 Oct 2019 13:21:31 UTC
- Distribution: Types-Encodings
- Module version: 0.003
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (294 / 2 / 0)
- Kwalitee
Bus factor: 2- 100.00% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity
24 month- Tools
- Download (14.51KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Types::Encodings - type constraints for Bytes and Chars
DESCRIPTION
Additional type constraints and coercions to complement Types::Standard.
Type constraints
Str
-
Alias for Types::Standard type constraint of the same name.
Bytes
-
Strings where
utf8::is_utf8()
is false. Chars
-
Strings where either
utf8::is_utf8()
is true, or each byte is below0x7F
.
Coercions
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: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.
BUGS
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=Types-Encodings.
SEE ALSO
AUTHOR
Toby Inkster <tobyink@cpan.org>.
COPYRIGHT AND LICENCE
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.
DISCLAIMER OF WARRANTIES
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.
Module Install Instructions
To install Types::Encodings, copy and paste the appropriate command in to your terminal.
cpanm Types::Encodings
perl -MCPAN -e shell install Types::Encodings
For more information on module installation, please visit the detailed CPAN module installation guide.