Lines Matching refs:encoding
380 $encoding = $config->get('Core.Encoding');
381 if ($encoding === 'utf-8') {
390 $str = self::unsafeIconv($encoding, 'utf-8//IGNORE', $str);
393 trigger_error('Invalid encoding ' . $encoding, E_USER_ERROR);
399 $str = strtr($str, self::testEncodingSupportsASCII($encoding));
401 } elseif ($encoding === 'iso-8859-1' && function_exists('mb_convert_encoding')) {
453 } elseif ($encoding === 'iso-8859-1' && function_exists('mb_convert_encoding')) {
566 * @param string $encoding Encoding name to test, as per iconv format
571 public static function testEncodingSupportsASCII($encoding, $bypass = false) argument
580 if (isset($encodings[$encoding])) {
581 return $encodings[$encoding];
583 $lenc = strtolower($encoding);
595 if (self::unsafeIconv('UTF-8', $encoding, 'a') === false) {
600 $r = self::unsafeIconv('UTF-8', "$encoding//IGNORE", $c); // initial conversion
604 ($r === $c && self::unsafeIconv($encoding, 'UTF-8//IGNORE', $r) !== $c)
609 $ret[self::unsafeIconv($encoding, 'UTF-8//IGNORE', $c)] = $c;
612 $encodings[$encoding] = $ret;