Encode:...de::UTF7(3)
π NAME π
Encode::Unicode::UTF7 β UTF-7 encoding, bestie π
Hey hi, this is Encode:...de::UTF7(3) from the User Contributed Perl Documentation, and we are about to vibe-check UTF-7 together. No cap.
β¨ SYNOPSIS β¨
use Encode qw/encode decode/;
$utf7 = encode("UTF-7", $utf8);
$utf8 = decode("UTF-7", $ucs2);
π ABSTRACT π
Okay so this module implements UTF-7 encoding documented in RFC 2152. UTF-7, as its name suggests (iconic naming tbh), is a 7-bit re-encoded version of UTF-16BE. It is designed to be MTA-safe and expected to be a standard way to exchange Unicoded mails via mails. But with the advent of UTF-8 and 8-bit compliant MTAs, UTF-7 is hardly ever used. Lowkey a relic, but she served. π
UTF-7 was not supported by Encode until version 1.95 because of that. But Unicode::String, a module by Gisle Aas which adds Unicode supports to non-utf8-savvy perl did support UTF-7, the UTF-7 support was added so Encode can supersede Unicode::String 100%. Periodt. β¨
π¦ In Practice π¦
When you want to encode Unicode for mails and web pages, however, do not use UTF-7 unless you are sure your recipients and readers can handle it. Very few MUAs and WWW Browsers support these days (only Mozilla seems to support one). For general cases, use UTF-8 for message body and MIME-Header for header instead.
β οΈ bestie, fr fr: do not use UTF-7 unless you are sure your recipients and readers can handle it. That is the whole vibe check. The modern move isUTF-8for the message body andMIME-Headerfor the header.
π SEE ALSO π
EncodeEncode::UnicodeUnicode::StringRFC 2781 <http://www.ietf.org/rfc/rfc2152.txt>
And that is the tea π this page is from perl v5.42.0, dated 2024-03-08, and yes she ate. Byeeeee πβ¨π¦
π¦ where this page comes from
- opensuse-leap 16.0: perl-Encode 3.210.0-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Encode 3.210.0-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Encode 3.210.0-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Encode 3.210.0-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms