diff --git a/includes/unicode.inc b/includes/unicode.inc index 228981b..4c20245 100644 --- a/includes/unicode.inc +++ b/includes/unicode.inc @@ -272,17 +272,15 @@ function truncate_utf8($string, $len, $wordsafe = FALSE, $dots = FALSE) { * - Only encode strings that contain non-ASCII characters. * - We progressively cut-off a chunk with truncate_utf8(). This is to ensure * each chunk starts and ends on a character boundary. - * - Using \n as the chunk separator may cause problems on some systems and may - * have to be changed to \r\n or \r. */ function mime_header_encode($string) { if (preg_match('/[^\x20-\x7E]/', $string)) { - $chunk_size = 47; // floor((75 - strlen("=?UTF-8?B??=")) * 0.75); + $chunk_size = 45; // floor((75 - strlen("=?UTF-8?B??=\r\n ")) * 0.75); $len = strlen($string); $output = ''; while ($len > 0) { $chunk = drupal_truncate_bytes($string, $chunk_size); - $output .= ' =?UTF-8?B?'. base64_encode($chunk) ."?=\n"; + $output .= ' =?UTF-8?B?'. base64_encode($chunk) ."?=\r\n "; $c = strlen($chunk); $string = substr($string, $c); $len -= $c;