When ftn2rfc is gating from cyrillic CP866 charset into UTF-8 encoded with base64 in cases of long strings the headers are splitting into several lines. It is ok, but Fidogare often splits these lines in the wrong place: in the middle of the UTF8 multibyte sequence, which means that the next line not begin with an UTF sequence when decoding from base64. This causes some email clients and newsreaders to cut the Headers like Subject or Organization when decoding from base64. It would be necessary to fix this algorithm in accordance with RFC2047 and not break header lines in the middle of the letters.
RFC 2047 specifically forbids this:
Each 'encoded-word' MUST encode an integral number of octets. The
'encoded-text' in each 'encoded-word' must be well-formed according
to the encoding specified; the 'encoded-text' may not be continued in
the next 'encoded-word'. (For example, "=?charset?Q?=?=
=?charset?Q?AB?=" would be illegal, because the two hex digits "AB"
must follow the "=" in the same 'encoded-word'.)
Each 'encoded-word' MUST represent an integral number of characters.
A multi-octet character may not be split across adjacent 'encoded-
word's.
Examples:
FTN Subject:
А почему не пошла в магазин и не купила телячью отбивную?
RFC:
Subject: =?utf-8?B?0JAg0L/QvtGH0LXQvNGDINC90LUg0L/QvtGI0LvQsCDQsiDQvNCw?==?utf-8?B?0LPQsNC30LjQvSDQuCDQvdC1INC60YPQv9C40LvQsCDRgtC10LvRj9GH0YzR?==?utf-8?B?jiDQvtGC0LHQuNCy0L3Rg9GOPwo=?=
FTN Subject:
Это ваше ФИДО (переиздание)
RFC:
Subject: =?utf-8?B?0K3RgtC+INCy0LDRiNC1INCk0JjQlNCeICjQv9C10YDQtdC40LfQ?==?utf-8?B?tNCw0L3QuNC1KQo=?=
FTN Origin:
А Ларчик просто открывался...
RFC:
Organization: =?utf-8?B?0JAg0JvQsNGA0YfQuNC6INC/0YDQvtGB0YLQviDQvtGC0LrR?==?utf-8?B?gNGL0LLQsNC70YHRjy4uLgo=?=
When ftn2rfc is gating from cyrillic CP866 charset into UTF-8 encoded with base64 in cases of long strings the headers are splitting into several lines. It is ok, but Fidogare often splits these lines in the wrong place: in the middle of the UTF8 multibyte sequence, which means that the next line not begin with an UTF sequence when decoding from base64. This causes some email clients and newsreaders to cut the Headers like Subject or Organization when decoding from base64. It would be necessary to fix this algorithm in accordance with RFC2047 and not break header lines in the middle of the letters. RFC 2047 specifically forbids this:
Examples:
А почему не пошла в магазин и не купила телячью отбивную?
RFC:Subject: =?utf-8?B?0JAg0L/QvtGH0LXQvNGDINC90LUg0L/QvtGI0LvQsCDQsiDQvNCw?=
=?utf-8?B?0LPQsNC30LjQvSDQuCDQvdC1INC60YPQv9C40LvQsCDRgtC10LvRj9GH0YzR?=
=?utf-8?B?jiDQvtGC0LHQuNCy0L3Rg9GOPwo=?=
Это ваше ФИДО (переиздание)
RFC:Subject: =?utf-8?B?0K3RgtC+INCy0LDRiNC1INCk0JjQlNCeICjQv9C10YDQtdC40LfQ?=
=?utf-8?B?tNCw0L3QuNC1KQo=?=
А Ларчик просто открывался...
RFC:Organization: =?utf-8?B?0JAg0JvQsNGA0YfQuNC6INC/0YDQvtGB0YLQviDQvtGC0LrR?=
=?utf-8?B?gNGL0LLQsNC70YHRjy4uLgo=?=
`