| 1 | <?php |
||
| 9 | class CharacterEncodingConvert implements RobotsTxtInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * String to convert |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $string; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Source encoding |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | protected $source; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Destination encoding |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | protected $destination; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * CharacterEncodingConvert constructor. |
||
| 31 | * |
||
| 32 | * @param string $string |
||
| 33 | * @param string $source |
||
| 34 | * @param string $destination |
||
| 35 | */ |
||
| 36 | public function __construct($string, $source, $destination = self::ENCODING) |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Auto mode |
||
| 45 | * |
||
| 46 | * @return string|false |
||
| 47 | */ |
||
| 48 | public function auto() |
||
| 60 | |||
| 61 | /** |
||
| 62 | * iconv |
||
| 63 | * |
||
| 64 | * @param string $outSuffix |
||
| 65 | * @return string|false |
||
| 66 | */ |
||
| 67 | public function iconv($outSuffix = '//TRANSLIT//IGNORE') |
||
| 76 | |||
| 77 | /** |
||
| 78 | * mb_convert_encoding |
||
| 79 | * |
||
| 80 | * @param array|string|null $fromOverride |
||
| 81 | * @return string|false |
||
| 82 | */ |
||
| 83 | public function mbstring($fromOverride = null) |
||
| 96 | |||
| 97 | /** |
||
| 98 | * mb_internal_encoding |
||
| 99 | * |
||
| 100 | * @return bool |
||
| 101 | */ |
||
| 102 | protected function fallback() |
||
| 112 | } |
||
| 113 |