On Sat, 22 May 2004 10:20:48 -0400 Sam Varshavchik <[EMAIL PROTECTED]> wrote:
> 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. Uh, sorry. > 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. With 'small by small' approach, wrapped lines will be a bit ragged. Because multibyte string may contain both multibyte and singlebyte characters. However, it is compliant to MIME. Anyway, additional fixes are attached (diff to 20040522 patch). Thanks. --- nezumi
sqwebmail-4.0.4-20040522_fix0523.patch
Description: Binary data
