Введение
Отношения между Unicode и электронной почтой
Many email clients now offer some support for Unicode. Some clients will automatically choose between a legacy encoding and Unicode depending on the mail's content, either automatically or when the user requests it. Technical requirements for sending of messages containing non ASCII characters by email include
encoding of certain header fields (subject, sender's and recipient's names, sender's organization and reply to name) and, optionally, body in a content transfer encoding
encoding of non ASCII characters in one of the Unicode transforms
negotiating the use of UTF 8 encoding in email addresses and reply codes (SMTPUTF8)
sending the information about the content transfer encoding and the Unicode transform used so that the message can be correctly displayed by the recipient (see Mojibake). If the sender's or recipient's email address contains non ASCII characters, sending of a message requires also encoding of these to a format that can be understood by mail servers.
Многие почтовые клиенты сейчас обеспечивают некоторую поддержку Unicode. Некоторые клиенты автоматически выбирают между устаревшей кодировкой и Unicode в зависимости от содержимого письма, либо автоматически, либо по запросу пользователя. Технические требования к отправке сообщений, содержащих символы, отличные от ASCII, по электронной почте включают:
Many email clients now offer some support for Unicode. Some clients will automatically choose between a legacy encoding and Unicode depending on the mail's content, either automatically or when the user requests it. Technical requirements for sending of messages containing non ASCII characters by email include
encoding of certain header fields (subject, sender's and recipient's names, sender's organization and reply to name) and, optionally, body in a content transfer encoding
encoding of non ASCII characters in one of the Unicode transforms
negotiating the use of UTF 8 encoding in email addresses and reply codes (SMTPUTF8)
sending the information about the content transfer encoding and the Unicode transform used so that the message can be correctly displayed by the recipient (see Mojibake). If the sender's or recipient's email address contains non ASCII characters, sending of a message requires also encoding of these to a format that can be understood by mail servers.
кодирование определенных полей заголовка (тема, имена отправителя и получателя, организация отправителя и адрес для ответа) и, опционально, тела сообщения с использованием кодировки передачи содержимого;
кодирование символов, отличных от ASCII, с помощью одного из преобразований Unicode;
согласование использования кодировки UTF-8 в адресах электронной почты и кодах ответа (SMTPUTF8);
отправку информации о кодировке передачи содержимого и используемом преобразовании Unicode, чтобы сообщение могло быть правильно отображено получателем (см. Mojibake). Если адрес электронной почты отправителя или получателя содержит символы, отличные от ASCII, отправка сообщения также требует кодирования этих символов в формат, который может быть понят почтовыми серверами.
Many email clients now offer some support for Unicode. Some clients will automatically choose between a legacy encoding and Unicode depending on the mail's content, either automatically or when the user requests it. Technical requirements for sending of messages containing non ASCII characters by email include
encoding of certain header fields (subject, sender's and recipient's names, sender's organization and reply to name) and, optionally, body in a content transfer encoding
encoding of non ASCII characters in one of the Unicode transforms
negotiating the use of UTF 8 encoding in email addresses and reply codes (SMTPUTF8)
sending the information about the content transfer encoding and the Unicode transform used so that the message can be correctly displayed by the recipient (see Mojibake). If the sender's or recipient's email address contains non ASCII characters, sending of a message requires also encoding of these to a format that can be understood by mail servers.
Поддержка Unicode в телах сообщений
Как и во всех кодировках, кроме US ASCII, при использовании текста Unicode в электронной почте необходимо использовать MIME для указания того, что для текста применяется формат преобразования Unicode. UTF-7, устаревшая кодировка, имела преимущество перед кодировками Unicode в устаревших сетях, не поддерживающих 8-битную передачу, поскольку не требовала кодирования передачи для соответствия семибитным ограничениям устаревших почтовых серверов Интернета. С другой стороны, UTF-16 необходимо кодировать для передачи в соответствии с форматом данных SMTP. Хотя это и не является строго обязательным, UTF-8 обычно также кодируется для передачи, чтобы избежать проблем с семибитными почтовыми серверами. Кодирование передачи MIME для UTF-8 делает его либо нечитаемым в виде обычного текста (в случае base64), либо, для некоторых языков и типов текста, значительно неэффективным по размеру (в случае quoted-printable). Некоторые форматы документов, такие как HTML, PostScript и Rich Text Format, имеют собственные 7-битные схемы кодирования для не-ASCII символов и, следовательно, могут быть отправлены без использования специальных кодировок электронной почты. Например, HTML-письма могут использовать HTML-сущности для отображения символов из любой точки Unicode, даже если исходный HTML-текст письма использует устаревшую кодировку (например, 7-битный ASCII). Подробности см. в разделе Unicode и HTML.