.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Encode::IMAPUTF7 3" .TH Encode::IMAPUTF7 3 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Encode::IMAPUTF7 \- modification of UTF\-7 encoding for IMAP .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Encode qw/encode decode/; \& \& print encode(\*(AqIMAP\-UTF\-7\*(Aq, \*(AqRépertoire\*(Aq); \& print decode(\*(AqIMAP\-UTF\-7\*(Aq, R&AOk\-pertoire\*(Aq); .Ve .SH ABSTRACT .IX Header "ABSTRACT" IMAP mailbox names are encoded in a modified UTF7 when names contains international characters outside of the printable ASCII range. The modified UTF\-7 encoding is defined in RFC2060 (section 5.1.3). .PP There is another CPAN module with same purpose, Unicode::IMAPUtf7. However, it works correctly only with strings, which encoded form does not contain plus sign. For example, the Cyrillic string \&\ex{043f}\ex{0440}\ex{0435}\ex{0434}\ex{043b}\ex{043e}\ex{0433} is represented in UTF\-7 as +BD8EQAQ1BDQEOwQ+BDM\- Note the second plus sign 4 characters before the end. Unicode::IMAPUtf7 encodes the above string as +BD8EQAQ1BDQEOwQ&BDM\- which is not valid modified UTF\-7 (the ampersand and the plus are swapped). The problem is solved by the current module, which is slightly modified Encode::Unicode::UTF7 and has nothing common with Unicode::IMAPUtf7. .SH "RFC2060 \- section 5.1.3 \- Mailbox International Naming Convention" .IX Header "RFC2060 - section 5.1.3 - Mailbox International Naming Convention" By convention, international mailbox names are specified using a modified version of the UTF\-7 encoding described in [UTF\-7]. The purpose of these modifications is to correct the following problems with UTF\-7: .PP 1) UTF\-7 uses the "+" character for shifting; this conflicts with the common use of "+" in mailbox names, in particular USENET newsgroup names. .PP 2) UTF\-7's encoding is BASE64 which uses the "/" character; this conflicts with the use of "/" as a popular hierarchy delimiter. .PP 3) UTF\-7 prohibits the unencoded usage of "\e"; this conflicts with the use of "\e" as a popular hierarchy delimiter. .PP 4) UTF\-7 prohibits the unencoded usage of "~"; this conflicts with the use of "~" in some servers as a home directory indicator. .PP 5) UTF\-7 permits multiple alternate forms to represent the same string; in particular, printable US-ASCII chararacters can be represented in encoded form. .PP In modified UTF\-7, printable US-ASCII characters except for "&" represent themselves; that is, characters with octet values 0x20\-0x25 and 0x27\-0x7e. The character "&" (0x26) is represented by the two\- octet sequence "&\-". .PP All other characters (octet values 0x00\-0x1f, 0x7f\-0xff, and all Unicode 16\-bit octets) are represented in modified BASE64, with a further modification from [UTF\-7] that "," is used instead of "/". Modified BASE64 MUST NOT be used to represent any printing US-ASCII character which can represent itself. .PP "&" is used to shift to modified BASE64 and "\-" to shift back to US\- ASCII. All names start in US-ASCII, and MUST end in US-ASCII (that is, a name that ends with a Unicode 16\-bit octet MUST end with a "\- "). .PP For example, here is a mailbox name which mixes English, Japanese, and Chinese text: ~peter/mail/&ZeVnLIqe\-/&U,BTFw\- .SH "REQUESTS & BUGS" .IX Header "REQUESTS & BUGS" Please report any requests, suggestions or bugs via the RT bug-tracking system at http://rt.cpan.org/ or email to bug\-Encode\-IMAPUTF7@rt.cpan.org. .PP http://rt.cpan.org/NoAuth/Bugs.html?Dist=Encode\-IMAPUTF7 is the RT queue for Encode::IMAPUTF7. Please check to see if your bug has already been reported. .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright 2005 Sava Chankov .PP Sava Chankov, sava@cpan.org .PP This software may be freely copied and distributed under the same terms and conditions as Perl. .SH AUTHORS .IX Header "AUTHORS" Peter Makholm , current maintainer .PP Sava Chankov , original author .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBperl\fR\|(1), Encode. .SH "POD ERRORS" .IX Header "POD ERRORS" Hey! \fBThe above document had some coding errors, which are explained below:\fR .IP "Around line 90:" 4 .IX Item "Around line 90:" Non-ASCII character seen before =encoding in ''Répertoire');'. Assuming UTF\-8