ENCODE::UNICODE::UTF7(3pm)

πŸ’– NAME πŸ’–

Encode::Unicode::UTF7 -- UTF-7 encoding. That's the name, bestie, and it's giving UTF-7 realness πŸ’…. This is the Encode::Unicode::UTF7(3pm) page from the Perl Programmers Reference Guide, folded in right here at the top ✨.

✨ SYNOPSIS ✨

Okay so the synopsis is short and iconic:

use Encode qw/encode decode/;
$utf7 = encode("UTF-7", $utf8);
$utf8 = decode("UTF-7", $ucs2);

πŸ¦‹ ABSTRACT πŸ¦‹

Okay so here's the lore: this module implements UTF-7 encoding documented in RFC 2152. UTF-7, as its name suggests, 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. No cap. πŸ’€

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, and the UTF-7 support was added so Encode can supersede Unicode::String 100%.

🌸 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 warning: this is literally the manual telling you UTF-7 is not the move for random mail/web-page encoding unless everyone on the other side can handle it. 😭

πŸŽ€ SEE ALSO πŸŽ€


That's the whole page, bestie β€” from perl v5.42.3, dated 2026-11-03, and it's the Encode::Unicode::UTF7(3pm) manual. Mwah πŸ’‹

πŸ“¦ where this page comes from