1N/A# $Id: UTF7.pm,v 0.2 2003/05/19 04:56:03 dankogai Exp $ 1N/Ano warnings 'redefine';
1N/Aour $
VERSION =
do {
my @r = (q$
Revision:
0.2 $ =~ /\d+/g);
sprintf "%d.".
"%02d" x $
#r, @r }; 1N/A# Algorithms taken from Unicode::String by Gisle Aas 1N/A# \s will not work because it matches U+3000 DEOGRAPHIC SPACE 1N/A# We use qr/[\n\r\t\ ] instead 1N/A die "This should not happen! (pos=" .
pos($
str) .
")";
1N/A $^W
and warn "Bad UTF7 data escape";
1N/A die "This should not happen " .
pos($
bytes);
1N/AEncode::Unicode::UTF7 -- UTF-7 encoding 1N/A $utf7 = encode("UTF-7", $utf8); 1N/A $utf8 = decode("UTF-7", $ucs2); 1N/AThis module implements UTF-7 encoding documented in RFC 2152. UTF-7, 1N/Aas its name suggests, is a 7-bit re-encoded version of UTF-16BE. It 1N/Ais designed to be MTA-safe and expected to be a standard way to 1N/Aexchange Unicoded mails via mails. But with the advent of UTF-8 and 1N/A8-bit compliant MTAs, UTF-7 is hardly ever used. 1N/AUTF-7 was not supported by Encode until version 1.95 because of that. 1N/ABut Unicode::String, a module by Gisle Aas which adds Unicode supports 1N/Ato non-utf8-savvy perl did support UTF-7, the UTF-7 support was added 1N/Aso Encode can supersede Unicode::String 100%. 1N/AWhen you want to encode Unicode for mails and web pages, however, do 1N/Anot use UTF-7 unless you are sure your recipients and readers can 1N/Ahandle it. Very few MUAs and WWW Browsers support these days (only 1N/AMozilla seems to support one). For general cases, use UTF-8 for 1N/Amessage body and MIME-Header for header instead. 1N/AL<Encode>, L<Encode::Unicode>, L<Unicode::String>