Welcome Guest, Not a member yet? Register   Sign In
avoid ?utf-8?Q? in subject line
#3

[eluser]padmapriya[/eluser]
Hi All,
Here is the Path System/libraries/Email.php
It Worked for me by Avoid ?utf-8?Q? in subject line

Do following Comments in the Function below to avoid the special Characters..

/*Commented by Priya for SMS Subject Format to Avoid ?utf-8?Q? in subject line*/
//$char = '='.dechex($ascii);

/*Commented by Priya for SMS Subject Format to Avoid ?utf-8?Q? in subject line*/
//$char = '_';

/*Commented by Priya for SMS Subject Format to Avoid ?utf-8?Q? in subject line*/

//$str = trim(preg_replace('/^(.*)$/m', ' =?'.$this->charset.'?Q?$1?=', $str));


******************************************************************************************
private function _prep_q_encoding($str, $from = FALSE)
{
$str = str_replace(array("\r", "\n"), array('', ''), $str);

// Line length must not exceed 76 characters, so we adjust for
// a space, 7 extra characters =??Q??=, and the charset that we will add to each line
$limit = 75 - 7 - strlen($this->charset);

// these special characters must be converted too
$convert = array('_', '=', '?');

if ($from === TRUE)
{
$convert[] = ',';
$convert[] = ';';
}

$output = '';
$temp = '';

for ($i = 0, $length = strlen($str); $i < $length; $i++)
{
// Grab the next character
$char = substr($str, $i, 1);
$ascii = ord($char);

// convert ALL non-printable ASCII characters and our specials
if ($ascii < 32 OR $ascii > 126 OR in_array($char, $convert))
{
/*Commented by Priya for SMS Subject Format to Avoid ?utf-8?Q? in subject line*/
//$char = '='.dechex($ascii);
}

// handle regular spaces a bit more compactly than =20
if ($ascii == 32)
{
/*Commented by Priya for SMS Subject Format to Avoid ?utf-8?Q? in subject line*/
//$char = '_';
}

// If we're at the character limit, add the line to the output,
// reset our temp variable, and keep on chuggin'
if ((strlen($temp) + strlen($char)) >= $limit)
{
$output .= $temp.$this->crlf;
$temp = '';
}

// Add the character to our temporary line
$temp .= $char;
}

$str = $output.$temp;

// wrap each line with the shebang, charset, and transfer encoding
// the preceding space on successive lines is required for header "folding"

/*Commented by Priya for SMS Subject Format to Avoid ?utf-8?Q? in subject line*/

//$str = trim(preg_replace('/^(.*)$/m', ' =?'.$this->charset.'?Q?$1?=', $str));

return $str;
}


Messages In This Thread
avoid ?utf-8?Q? in subject line - by El Forum - 09-17-2012, 11:32 PM
avoid ?utf-8?Q? in subject line - by El Forum - 09-18-2012, 09:22 PM
avoid ?utf-8?Q? in subject line - by El Forum - 09-24-2012, 11:25 PM
avoid ?utf-8?Q? in subject line - by El Forum - 09-28-2012, 11:29 AM
avoid ?utf-8?Q? in subject line - by El Forum - 10-15-2012, 01:45 AM
avoid ?utf-8?Q? in subject line - by El Forum - 10-15-2012, 10:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB