Convert-XText

 view release on metacpan or  search on metacpan

lib/Convert/XText.pm  view on Meta::CPAN


Convert::XText - Convert from and to RFC 1891 xtext encoding

=head1 SYNOPSIS

  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'

=head1 DESCRIPTION

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 C<chr(33)> I<(!)> to C<chr(126)> I<(~)>, as well as the
plus I<(+)> and equal I<(=)> sign, into a plus sign followed by a two

lib/Convert/XText.pm  view on Meta::CPAN


=over 4

=item encode_xtext ($string_to_encode)

Expects a non-unicode-string to encode in xtext encoding. Returns
the encoded text.

=item decode_xtext ($string_to_decode)

Expects an xtext-encoded string and returns the decoded string.

=back

=head2 EXPORT

None by default.

You can manually export encode_xtext and decode_xtext:

    use Convert::XText qw(encode_xtext);



( run in 0.631 second using v1.01-cache-2.11-cpan-26ccb49234f )