|
Convert::XText - Convert from and to RFC 1891 xtext encoding |
Convert::XText - Convert from and to RFC 1891 xtext encoding
use Convert::XText;
my $encoded = Convert::XText::encode_xtext('String to=encode');
# $encoded contains "String+20to+3Dencode"
my $decoded = Convert::XText::decode_xtext($encoded); # $decoded contains 'String to=encode'
RFC1891 defines the xtext encoding for delivery service notifications, to encode non-standard-ascii characters and special chars in a simple and fast, as well as easily reversible, way.
The input data for encode_xtext simply converts all characters outside
the range of chr(33) (!) to chr(126) (~), as well as the
plus (+) and equal (=) sign, into a plus sign followed by a two
digit uppercase hexadecimal representation of the character code.
For example, the ``='' sign, ASCII 61 or \x3d, will be converted to +3D.
None by default.
You can manually export encode_xtext and decode_xtext:
use Convert::XText qw(encode_xtext);
encode_xtext( $string_to_encode );
http://www.faqs.org/rfcs/rfc1891.html - The original xtext definition
http://www.postfix.org/XCLIENT_README.html - Special usage of xtext encoding
Chr. Winter, <CHRWIN@cpan.org>
Copyright (C) 2007 by Chr. Winter
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
|
Convert::XText - Convert from and to RFC 1891 xtext encoding |