Re: content encoding etc. (updated)

Sam Varshavchik <[email protected]> Sat, 22 May 2004 10:20:48 -0400
Newsgroups gmane.mail.sqwebmail
Message-ID <[email protected]>
Hatuka*nezumi - IKEDA Soji writes:

> Updated patch for 4.0.4. I splitted it to 4 subpatches.
> 
> # Changes on flowed format are removed.  I wish more suggestions.

1) Small problem in encodebase64().  When generating multiple encoded words, 
they need to be separated by spaces.  As it is, encodebase64() will generate 
"=?...?==?...?=" with no intervening space.

2) The logic in rfc2047_encode_callback that tries to avoid breaking up 
multibyte characters is hard to follow.  I think there's a better approach.
First, convert the entire string to unicode.  Then, take a small chunk of 
unicodes and convert it back to the original charset.  If the result is 
larger than RFC2047_ENCODE_FOLDLENGTH, try again with a slightly smaller 
chunk.  Encode it, then repeat until the entire unicode string is done.

If you know that, on average, the charset uses two octets per character then 
you can make a pretty good guess as to how many unicodes to try, each time.
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQBAr2HAx9p3GYHlUOIRAldEAJsFhtz6eHTutly8QBL20xbxS+SNCACfd6aH
uE7mcF+aew18ziBWJWUyxQs=
=05TT
-----END PGP SIGNATURE-----