Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/polyfill-iconv/Iconv.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | c2387f117808 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
172 $loop = true; | 172 $loop = true; |
173 $inCharset = substr($inCharset, 0, -8); | 173 $inCharset = substr($inCharset, 0, -8); |
174 } | 174 } |
175 } while ($loop); | 175 } while ($loop); |
176 | 176 |
177 if (isset(self::$alias[ $inCharset])) { | 177 if (isset(self::$alias[$inCharset])) { |
178 $inCharset = self::$alias[ $inCharset]; | 178 $inCharset = self::$alias[$inCharset]; |
179 } | 179 } |
180 if (isset(self::$alias[$outCharset])) { | 180 if (isset(self::$alias[$outCharset])) { |
181 $outCharset = self::$alias[$outCharset]; | 181 $outCharset = self::$alias[$outCharset]; |
182 } | 182 } |
183 | 183 |
290 while ($i < $len) { | 290 while ($i < $len) { |
291 $c = strtolower($str[$i]); | 291 $c = strtolower($str[$i]); |
292 if ((ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) | 292 if ((ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) |
293 && 'utf-8' !== $c | 293 && 'utf-8' !== $c |
294 && !isset(self::$alias[$c]) | 294 && !isset(self::$alias[$c]) |
295 && !self::loadMap('from.', $c, $d)) { | 295 && !self::loadMap('from.', $c, $d)) { |
296 $d = false; | 296 $d = false; |
297 } elseif ('B' === strtoupper($str[$i + 1])) { | 297 } elseif ('B' === strtoupper($str[$i + 1])) { |
298 $d = base64_decode($str[$i + 2]); | 298 $d = base64_decode($str[$i + 2]); |
299 } else { | 299 } else { |
300 $d = rawurldecode(strtr(str_replace('%', '%25', $str[$i + 2]), '=_', '% ')); | 300 $d = rawurldecode(strtr(str_replace('%', '%25', $str[$i + 2]), '=_', '% ')); |
431 | 431 |
432 public static function iconv_strlen($s, $encoding = null) | 432 public static function iconv_strlen($s, $encoding = null) |
433 { | 433 { |
434 static $hasXml = null; | 434 static $hasXml = null; |
435 if (null === $hasXml) { | 435 if (null === $hasXml) { |
436 $hasXml = extension_loaded('xml'); | 436 $hasXml = \extension_loaded('xml'); |
437 } | 437 } |
438 | 438 |
439 if ($hasXml) { | 439 if ($hasXml) { |
440 return self::strlen1($s, $encoding); | 440 return self::strlen1($s, $encoding); |
441 } | 441 } |
693 } elseif ($ignore) { | 693 } elseif ($ignore) { |
694 continue; | 694 continue; |
695 } else { | 695 } else { |
696 return false; | 696 return false; |
697 } | 697 } |
698 } elseif ($ignore) { | |
699 continue; | |
700 } else { | |
701 return false; | |
698 } | 702 } |
699 | 703 |
700 $str = $uchr.substr($str, $i); | 704 $str = $uchr.substr($str, $i); |
701 $len = \strlen($str); | 705 $len = \strlen($str); |
702 $i = 0; | 706 $i = 0; |