Gets the Decomposition_Mapping property for the given UTF-8 encoded code point

# Normalizer::getRawDecomposition

# normalizer_get_raw_decomposition

(PHP 7 >= 7.3)

Normalizer::getRawDecomposition -- normalizer_get_raw_decomposition — Gets the Decomposition_Mapping property for the given UTF-8 encoded code point

### 説明

オブジェクト指向型

public static Normalizer::getRawDecomposition ( string `$input` ) : string

手続き型

normalizer_get_raw_decomposition ( string `$input` ) : string

Gets the Decomposition_Mapping property, as specified in the Unicode Character Database (UCD), for the given UTF-8 encoded code point.

### パラメータ

`input`

  The input string, which should be a single, UTF-8 encoded, code point.

### 返り値

Returns a string containing the Decomposition_Mapping property, if present in the UCD.

Returns `NULL` if there is no Decomposition_Mapping property for the character.

### 例

例1 Normalizer::getRawDecomposition() example

`<?php
$result = "";
$strings = [
"a",
"\u{FFDA}",
"\u{FDFA}",
"",
"aa",
"\xF5",
];
foreach ($strings as $string) {
$decomposition = Normalizer::getRawDecomposition($string);
// $decomposition = normalizer_get_raw_decomposition($string); Procedural way
$error_code = intl_get_error_code();
$error_message = intl_get_error_message();
$string_hex = bin2hex($string);
$result .= "---------------------\n";
if ($decomposition === null) {
$result .= "'$string_hex' has no decomposition mapping\n" ;
} else {
$result .= "'$string_hex' has the decomposition mapping '" . bin2hex($decomposition) . "'\n" ;
}
$result .= "error info: '$error_message' ($error_code)\n";
}
echo $result;
?>`

上の例の出力は以下となります。

    ---------------------
    '61' has no decomposition mapping
    error info: 'U_ZERO_ERROR' (0)
    ---------------------
    'efbf9a' has the decomposition mapping 'e385a1'
    error info: 'U_ZERO_ERROR' (0)
    ---------------------
    'efb7ba' has the decomposition mapping 'd8b5d984d98920d8a7d984d984d98720d8b9d984d98ad98720d988d8b3d984d985'
    error info: 'U_ZERO_ERROR' (0)
    ---------------------
    '' has no decomposition mapping
    error info: 'Input string must be exactly one UTF-8 encoded code point long.: U_ILLEGAL_ARGUMENT_ERROR' (1)
    ---------------------
    '6161' has no decomposition mapping
    error info: 'Input string must be exactly one UTF-8 encoded code point long.: U_ILLEGAL_ARGUMENT_ERROR' (1)
    ---------------------
    'f5' has no decomposition mapping
    error info: 'Code point out of range: U_ILLEGAL_ARGUMENT_ERROR' (1)

### 参考

- Normalizer::normalize() - 渡された入力を正規化し、正規化後の文字列を返す
- Normalizer::isNormalized() - 渡された文字列が、指定した正規化を適用済みかどうかを調べる