If you are really interested in PHP 6 and its Unicode support you should read:
http://www.zend.com/zend/week/php-unicode-design.txt
(and in general http://www.zend.com/zend/week/)
plus cvs/php6/README.UNICODE and cvs/php6/README.UNICODE-UPGRADES
After you compile PHP 6, make sure that you have enabled unicode_semantics = on in php.ini (an old PHP 5 configuration file will not do as it does not provide those new Unicode-related options).
CLXVII. Unicode Functions
Úvod
Unicode Support.
This extension is still in development and it isn't available to public yet.
Požadavky
» ICU 3.4 or later is required.
Instalace
First you should download and install ICU:
Příklad 2201. 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.
Konfigurace běhu
Chování těchto funkcí je ovlivněno nastavením parametrů v php.ini.
Tabulka 294. 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 | off | PHP_INI_PERDIR | Available since PHP 6.0.0. |
Pro další detaily a definice konstant PHP_INI_*, viz dokumentace k ini_set().
Zde je stručný popis konfiguračních direktiv.
- unicode.output_encoding string
Default encoding for output.
Předdefinované konstanty
Tyto konstanty jsou definovány tímto rozšířením a budou k dispozici pouze tehdy, bylo-li rozšíření zkompilováno společně s PHP nebo dynamicky zavedeno za běhu.
Tabulka 295.
| 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 |
Obsah
- i18n_loc_get_default — Get the default Locale
- i18n_loc_set_default — Set the default Locale
- unicode_encode — Set encoding of a unicode string
- unicode_semantics — Check whether unicode semantics is enabled
Unicode Functions
23-Nov-2005 07:04
