blob: a43138fbc2a61e64545e576724d16874c67c7018 [file] [log] [blame]
Taufan Aditya7756af52012-05-15 23:57:05 +07001<?php
2
3class Mock_Core_Utf8 extends CI_Utf8 {
Andrey Andreevf243ce12012-06-09 23:34:21 +03004
Taufan Aditya7756af52012-05-15 23:57:05 +07005 /**
Andrey Andreevf243ce12012-06-09 23:34:21 +03006 * We need to define several constants as
Taufan Aditya7756af52012-05-15 23:57:05 +07007 * the same process within CI_Utf8 class constructor.
8 *
9 * @covers CI_Utf8::__construct()
10 */
11 public function __construct()
12 {
Andrey Andreevf243ce12012-06-09 23:34:21 +030013 defined('UTF8_ENABLED') OR define('UTF8_ENABLED', TRUE);
Taufan Aditya7756af52012-05-15 23:57:05 +070014
15 if (extension_loaded('mbstring'))
16 {
Andrey Andreevf243ce12012-06-09 23:34:21 +030017 defined('MB_ENABLED') OR define('MB_ENABLED', TRUE);
Taufan Aditya7756af52012-05-15 23:57:05 +070018 mb_internal_encoding('UTF-8');
19 }
20 else
21 {
Andrey Andreevf243ce12012-06-09 23:34:21 +030022 defined('MB_ENABLED') OR define('MB_ENABLED', FALSE);
Taufan Aditya7756af52012-05-15 23:57:05 +070023 }
Taufan Aditya7756af52012-05-15 23:57:05 +070024 }
25
Andrey Andreev291676b2014-01-16 18:39:52 +020026 public function is_ascii_test($str)
27 {
28 return $this->_is_ascii($str);
29 }
30
Taufan Aditya7756af52012-05-15 23:57:05 +070031}