During the construction of the ENVELOPE response, we need to parse the email address headers such as From, To and Reply-to. For that we currently use gmime's InternetAddress interface which is very good at dealing with such data. Internally InternetAddress uses utf-8 encoding, while in the context of imap we need rfc2047 (utf-7) encoded headers.
So when the name of the sender is needed we need to encode that name, and for that I'm currently using; char * gmime_utils_header_encode_phrase(unsigned char *in); That call does a best-effort attempt at finding the right encoding for the utf-8 string 'in', which in this case returns iso-8859-5, even though that charset is said to be the least popular encoding for cyrillic characters according to the comments in gmime-utils.c. So, if it works for you I'm happy with it. If it becomes a problem for other users later on, we can escalate this upstream to the good folks at redhat who are working on gmime. Oleg Lapshin wrote: > Paul J Stevens wrote: > >>Oleg, >> >>I can fix this (somehat). But gmime returns >>=?iso-8859-5?b?sN3i3t0gvdXl3uDe6Njl?= >>when the input message contained >>=?koi8-r?Q?=E1=CE=D4=CF=CE=20=EE=C5=C8=CF=D2=CF=DB=C9=C8=20?= >>Would that be a problem? >> > > > Yes! > Now kmail don't freez while reading this message! > > But what is the need of such translation? > (from =?koi8-r?B? to =?iso-8859-5?b?) > > Thanks! > -- ________________________________________________________________ Paul Stevens paul at nfg.nl NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31 The Netherlands________________________________http://www.nfg.nl
