The Normalizer class
(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)
简介
Normalization is a process that involves transforming characters and sequences of characters into a formally-defined underlying representation. This process is most important when text needs to be compared for sorting and searching, but it is also used when storing text to ensure that the text is stored in a consistent representation.
The Unicode Consortium has defined a number of normalization forms reflecting the various needs of applications:
- Normalization Form D (NFD) - Canonical Decomposition
- Normalization Form C (NFC) - Canonical Decomposition followed by Canonical Composition
- Normalization Form KD (NFKD) - Compatibility Decomposition
- Normalization Form KC (NFKC) - Compatibility Decomposition followed by Canonical Composition
类摘要
class Normalizer
{
/* 常量 */
/* 方法 */
}预定义常量
The following constants define the normalization form used by the normalizer:
-
Normalizer::FORM_C
int - Normalization Form C (NFC) - Canonical Decomposition followed by Canonical Composition
-
Normalizer::FORM_D
int - Normalization Form D (NFD) - Canonical Decomposition
-
Normalizer::NFD
int -
Normalizer::FORM_KC
int - Normalization Form KC (NFKC) - Compatibility Decomposition, followed by Canonical Composition
-
Normalizer::NFKC
int -
Normalizer::FORM_KC_CF
int -
Normalizer::FORM_KD
int - Normalization Form KD (NFKD) - Compatibility Decomposition
-
Normalizer::NFKD
int -
Normalizer::NFC
int -
Normalizer::NFKC_CF
int
参见
更新日志
版本 | 说明 |
---|---|
8.4.0 | The class constants are now typed. |
8.0.0 |
Normalizer::NONE has been removed.
|
目录
- Normalizer::getRawDecomposition — Gets the Decomposition_Mapping property for the given UTF-8 encoded code point
- Normalizer::isNormalized — Checks if the provided string is already in the specified normalization form
- Normalizer::normalize — Normalizes the input provided and returns the normalized string
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。