[Hastymail-cvs] hastymail/lib general.php,1.281,1.282 smtp.php,1.144,1.145
Brought to you by:
sailfrog,
slushpupie
From: <sai...@us...> - 2005-12-21 17:36:33
|
Update of /cvsroot/hastymail/hastymail/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15654/lib Modified Files: general.php smtp.php Log Message: expanding on multibyte character support but still needs more testing so these additions are commented out for now Index: general.php =================================================================== RCS file: /cvsroot/hastymail/hastymail/lib/general.php,v retrieving revision 1.281 retrieving revision 1.282 diff -u -d -r1.281 -r1.282 --- general.php 19 Dec 2005 17:21:52 -0000 1.281 +++ general.php 21 Dec 2005 17:36:25 -0000 1.282 @@ -389,24 +389,49 @@ } $parts = array(); $string = $line; - while (strlen($string) > $limit) { - if (!$hardbreak) { - $chunk1 = substr($string, 0, ($limit-20)); - $chunk2 = substr($string, ($limit-20), 20); - $split = strlen($chunk1) + (strlen($chunk2) - strlen(strrchr($chunk2, " "))); - if ($split < $limit) { - $parts[] = $quotemarker.substr($string, 0, $split).$marker; - $string = substr($string, $split+1); + /*if ($_SESSION['mb']) { + while (mb_strlen($string, "UTF-8") > $limit) { + if (!$hardbreak) { + $chunk1 = mb_substr($string, 0, ($limit-20), "UTF-8"); + $chunk2 = mb_substr($string, ($limit-20), 20, "UTF-8"); + $split = mb_strlen($chunk1, "UTF-8") + (mb_strlen($chunk2, "UTF-8") - + mb_strlen(strrchr($chunk2, " "), "UTF-8")); + if ($split < $limit) { + $parts[] = $quotemarker.mb_substr($string, 0, $split, "UTF-8"). + $marker; + $string = mb_substr($string, $split+1, "UTF-8"); + } + else { + break; + } } else { - break; + $parts[] = $quotemarker.mb_substr($string, 0, $limit, "UTF-8").$marker; + $string = mb_substr($string, $limit, "UTF-8"); } } - else { - $parts[] = $quotemarker.substr($string, 0, $limit).$marker; - $string = substr($string, $limit); - } } + else {*/ + while (strlen($string) > $limit) { + if (!$hardbreak) { + $chunk1 = substr($string, 0, ($limit-20)); + $chunk2 = substr($string, ($limit-20), 20); + $split = strlen($chunk1) + (strlen($chunk2) - + strlen(strrchr($chunk2, " "))); + if ($split < $limit) { + $parts[] = $quotemarker.substr($string, 0, $split).$marker; + $string = substr($string, $split+1); + } + else { + break; + } + } + else { + $parts[] = $quotemarker.substr($string, 0, $limit).$marker; + $string = substr($string, $limit); + } + } + //} $parts[] = $quotemarker.$string; return $parts; } Index: smtp.php =================================================================== RCS file: /cvsroot/hastymail/hastymail/lib/smtp.php,v retrieving revision 1.144 retrieving revision 1.145 diff -u -d -r1.144 -r1.145 --- smtp.php 30 Nov 2005 19:53:19 -0000 1.144 +++ smtp.php 21 Dec 2005 17:36:25 -0000 1.145 @@ -366,12 +366,14 @@ $bndry = "--".$bndry; $smtp_message .= "$bndry\r\n"; $smtp_message .= "Content-Type: text/plain; charset=".$content_charset."\r\n"; + //$smtp_message .= "Content-Transfer-Encoding: quoted-printable\r\n"; $smtp_message .= "Content-Transfer-Encoding: 8bit\r\n"; $multi = true; } else { $smtp_message .= "Content-Type: text/plain; charset=".$content_charset."\r\n"; + //$smtp_message .= "Content-Transfer-Encoding: quoted-printable\r\n"; $multi = false; } @@ -384,11 +386,19 @@ if (strlen($string) > 78) { $line = rtrim(implode("\r\n", hm_split_line(rtrim($string), 76, false, true)), "\n")."\r\n"; + /*$line = preg_replace("~([\x01-\x08\x10-\x1F\x3D\x7F-\xFF])~e", + "sprintf('=%02X', ord('\\1'))", $line); + $line = preg_replace("~([\x09\x20])\n~e", + "sprintf('=%02X\n', ord('\\1'))", $line);*/ $new_imap_lines[] = $line; $new_lines[] = preg_replace("/^\.\r\n/", "..\r\n", $line); } else { $line = rtrim($string, "\r\n")."\r\n"; + /*$line = preg_replace("~([\x01-\x08\x10-\x1F\x3D\x7F-\xFF])~e", + "sprintf('=%02X', ord('\\1'))", $line); + $line = preg_replace("~([\x09\x20])\n~e", + "sprintf('=%02X\n', ord('\\1'))", $line);*/ $new_imap_lines[] = $line; $new_lines[] = preg_replace("/^\.\r\n/", "..\r\n", $line); } |