コード例 #1
0
/**
 * Take a series of space-separated hexadecimal numbers representing
 * Unicode code points and return a UTF-8 string composed of those
 * characters. Used by UTF-8 data generation and testing routines.
 *
 * @param string $sequence
 * @return string
 * @throws InvalidArgumentException if fed out of range data.
 * @private
 * @deprecated since 1.25, use UtfNormal\Utils directly
 */
function hexSequenceToUtf8($sequence)
{
    return Utils::hexSequenceToUtf8($sequence);
}
コード例 #2
0
ファイル: generate.php プロジェクト: wikimedia/utfnormal
        $combiningClass[$source] = intval($canonicalCombiningClass);
    }
    if ($decompositionMapping === '') {
        continue;
    }
    if (preg_match('/^<(.+)> (.*)$/', $decompositionMapping, $matches)) {
        # Compatibility decomposition
        $canonical = false;
        $decompositionMapping = $matches[2];
        $compat++;
    } else {
        $canonical = true;
        $canon++;
    }
    $total++;
    $dest = Utils::hexSequenceToUtf8($decompositionMapping);
    $compatibilityDecomp[$source] = $dest;
    if ($canonical) {
        $canonicalDecomp[$source] = $dest;
        if (empty($exclude[$source])) {
            $canonicalComp[$dest] = $source;
        }
    }
    # print "$codepoint | $canonicalCombiningClasses | $decompositionMapping\n";
}
fclose($in);
print "Recursively expanding canonical mappings...\n";
$changed = 42;
$pass = 1;
while ($changed > 0) {
    print "pass {$pass}\n";