function Idn::mapCodePoints
Parameters
string $input:
array<string, bool> $options:
Return value
string
See also
https://www.unicode.org/reports/tr46/#ProcessingStepMap
1 call to Idn::mapCodePoints()
- Idn::process in vendor/
symfony/ polyfill-intl-idn/ Idn.php
File
-
vendor/
symfony/ polyfill-intl-idn/ Idn.php, line 272
Class
- Idn
- @internal
Namespace
Symfony\Polyfill\Intl\IdnCode
private static function mapCodePoints($input, array $options, Info $info) {
$str = '';
$useSTD3ASCIIRules = $options['UseSTD3ASCIIRules'];
$transitional = $options['Transitional_Processing'];
foreach (self::utf8Decode($input) as $codePoint) {
$data = self::lookupCodePointStatus($codePoint, $useSTD3ASCIIRules);
switch ($data['status']) {
case 'disallowed':
case 'valid':
$str .= mb_chr($codePoint, 'utf-8');
break;
case 'ignored':
// Do nothing.
break;
case 'mapped':
$str .= $transitional && 0x1e9e === $codePoint ? 'ss' : $data['mapping'];
break;
case 'deviation':
$info->transitionalDifferent = true;
$str .= $transitional ? $data['mapping'] : mb_chr($codePoint, 'utf-8');
break;
}
}
return $str;
}