deutsch english 

Convert::XText

Die XText-Kodierung ist eine einfache Umwandlung um Zeichen mit mehr als 7 Bit im Standard-ASCII-Zeichensatz reversibel abzubilden. Es wird z.B. bei der Kommunikation zwischen Mailservern über das ESMTP-Protokoll verwendet. Anstatt die Konvertierung manuell programmieren zu müssen (die allerdings nicht besonders schwierig ist) stellt dieses Module die Funktionen decode_xtext() und encode_xtext() bereit.

 

Perldoc Documentation

perldoc Convert::XText

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

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'

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 "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.

FUNCTIONS
encode_xtext ($string_to_encode)
Expects a non-unicode-string to encode in xtext encoding. Returns
the encoded text.

decode_xtext ($string_to_decode)
Expects an xtext-encoded string and returns the decoded string.

EXPORT
None by default.

You can manually export encode_xtext and decode_xtext:

use Convert::XText qw(encode_xtext);

encode_xtext( $string_to_encode );

SEE ALSO
http://www.faqs.org/rfcs/rfc1891.html - The original xtext definition

http://www.postfix.org/XCLIENT_README.html - Special usage of xtext
encoding

AUTHOR
Chr. Winter