Unicode Functions

简介

Unicode Support.

Warning

This extension is still in development and it isn't available to public yet.

需求

» ICU 3.4 or later is required.

安装

First you should download and install ICU:

Example#1 install ICU on Unix


./configure --disable-threads --enable-extras --enable-icuio --enable-layout

make && make install

Then checkout latest PHP and configure it --with-icu-dir=<dir> option, where <dir> was the dir to where you installed ICU. You don't need to explicitly use this option if you install ICU to a standard location.

运行时配置

这些函数的行为受 php.ini 的影响。

Unicode Configuration Options
Name Default Changeable Changelog
unicode.fallback_encoding NULL PHP_INI_ALL Available since PHP 6.0.0.
unicode.from_error_mode "2" PHP_INI_ALL Available since PHP 6.0.0.
unicode.from_error_subst_char "3f" PHP_INI_ALL Available since PHP 6.0.0.
unicode.http_input_encoding NULL PHP_INI_ALL Available since PHP 6.0.0.
unicode.output_encoding NULL PHP_INI_ALL Available since PHP 6.0.0.
unicode.runtime_encoding NULL PHP_INI_ALL Available since PHP 6.0.0.
unicode.script_encoding NULL PHP_INI_ALL Available since PHP 6.0.0.
unicode.semantics "0" PHP_INI_SYSTEM Available since PHP 6.0.0.
有关 PHP_INI_* 常量进一步的细节与定义参见php.ini 配置选项

以下是配置选项的简要解释。

unicode.output_encoding string

Default encoding for output.

预定义常量

以下常量由本扩展模块定义,因此只有在本扩展模块被编译到 PHP 中,或者在运行时被动态加载后才有效。

constant value description
U_INVALID_STOP 0 stop at first invalid character
U_INVALID_SKIP 1 skip invalid characters
U_INVALID_SUBSTITUTE 2 replace invalid characters
U_INVALID_ESCAPE 3 escape invalid characters

Table of Contents



Host by Alair