Welcome Guest, Not a member yet? Register   Sign In
Email class Encoding
#1

[eluser]kenjis[/eluser]
Code:
$this->load->library('email');

        $config['charset'] = 'us-ascii';
        $this->email->initialize($config);

        $this->email->from('[email protected]', 'Your Name');
        $this->email->to('[email protected]');

        $this->email->subject('Email Test');
        $this->email->message('Testing the email class.');

        $this->email->send();

The above code sends email with

Quote:Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit

But us-ascii must be 7bit.
#2

[eluser]kenjis[/eluser]
Is there anyone who knows meaning of "$_base_charsets"?
and why default $_encoding = "8bit" ?
#3

[eluser]ejangi[/eluser]
Not too sure, but my guess is it has something to do with UTF-8??? Just a guess.
#4

[eluser]Armchair Samurai[/eluser]
Kenjiさん。

$_base_charsets is used to determine which encodings should be considered 7bits - everything else is (erronously) set to 8bits. I'm guessing the $_encoding variable is set to 8-bits because the default encoding is utf-8.

わかった?

Code:
/**
|
| From the Email library
|
*/
function _get_encoding($return = true)
{        
    $this->_encoding = (!in_array($this->_encoding, $this->_bit_depths)) ? '7bit' : $this->_encoding;

    if (!in_array($this->charset, $this->_base_charsets, TRUE))
        $this->_encoding = "8bit";

    if ($return == true)
        return $this->_encoding;
}
#5

[eluser]kenjis[/eluser]
Hi, Armchair Samurai!

[quote author="Armchair Samurai" date="1198156578"]
$_base_charsets is used to determine which encodings should be considered 7bits
[/quote]

My question: "iso-8859-1" is 8bit, isn't it?




Theme © iAndrew 2016 - Forum software by © MyBB