CI_Utf8::__construct PHP Method

__construct() public method

Determines if UTF-8 support is to be enabled.
public __construct ( ) : void
return void
    public function __construct()
    {
        if (defined('PREG_BAD_UTF8_ERROR') && (ICONV_ENABLED === TRUE or MB_ENABLED === TRUE) && strtoupper(config_item('charset')) === 'UTF-8') {
            define('UTF8_ENABLED', TRUE);
            log_message('debug', 'UTF-8 Support Enabled');
        } else {
            define('UTF8_ENABLED', FALSE);
            log_message('debug', 'UTF-8 Support Disabled');
        }
        log_message('info', 'Utf8 Class Initialized');
    }

Usage Example

Example #1
0
 /**
  * We need to define UTF8_ENABLED the same way that
  * CI_Utf8 constructor does.
  */
 public function __construct()
 {
     if (defined('UTF8_ENABLED')) {
         return;
     }
     parent::__construct();
 }