XL. iconv

Wprowadzenie

Ten moduł zawiera interfejs do funkcji biblioteki iconv. Funkcje bilioteki iconv konwertują stringi pomiędzy różnymi zestawami znaków. Obsługa określonych zestawów znaków jest zależna od implementacji iconv() w twoim systemie. Proszę pamiętać, że w niektórych systemach funkcja iconv() działa niezgodnie z oczekiwaniami. W takich przypadkach należy zainstalować bibliotekę libiconv.

Wymagania

Trzeba mieć funkcję iconv() w standardowej bibliotece C, lub zainstalowaną bibliotekę libiconv. Biblioteka libiconv jest dostępna pod adresem http://www.gnu.org/software/libiconv/.

Instalacja

To use functions provided by this module, the PHP binary must be built with the following configure line: --with-iconv[=DIR].

Note to Windows® Users: In order to enable this module on a Windows® environment, you need to put a DLL file named iconv.dll or iconv-1.3.dll (prior to 4.2.1) which is bundled with the PHP/Win32 binary package into a directory specified by the PATH environment variable or one of the system directories of your Windows® installation.

Konfiguracja startowa

Na działanie tych funcji wpływają ustawienia zawarte w pliku php.ini.

Tabela 1. Iconv configuration options

NameDefaultChangeable
iconv.input_encodingICONV_INPUT_ENCODINGPHP_INI_ALL
iconv.output_encodingICONV_OUTPUT_ENCODINGPHP_INI_ALL
iconv.internal_encodingICONV_INTERNAL_ENCODINGPHP_INI_ALL
For further details and definition of the PHP_INI_* constants see ini_set().

Typy zasobów

To rozszerzenie nie posiada żadnych rodzajów zasobów.

Predefiniowane stałe

Since PHP 4.3.0 it is possible to identify at runtime which iconv implementation is adopted by this extension.

Tabela 2. iconv constants

NameTypeDescription
ICONV_IMPLstringThe implementation name
ICONV_VERSIONstringThe implementation version

Notatka: Writing implementation-dependent scripts with these constants is strongly discouraged.

Since PHP 5.0.0, the following constants are also available:

Tabela 3. iconv constants available since PHP 5.0.0

NameTypeDescription
ICONV_MIME_DECODE_STRICTintegerA bitmask used for iconv_mime_decode()
ICONV_MIME_DECODE_CONTINUE_ON_ERRORintegerA bitmask used for iconv_mime_decode()

Zobacz również

Patrz także: funkcje GNU Recode

Spis treści
iconv_get_encoding -- Pobiera aktualne ustawienia dla konwersji zestawu znaków
iconv_mime_decode_headers --  Decodes multiple MIME header fields at once
iconv_mime_decode --  Decodes a MIME header field
iconv_mime_encode --  Composes a MIME header field
iconv_set_encoding -- Ustawia aktualne ustawienia dla konwersji zestawu znaków
iconv_strlen --  Returns the character count of string
iconv_strpos --  Finds position of first occurrence of a needle within a haystack.
iconv_strrpos --  Finds the last occurrence of a needle within the specified range of haystack.
iconv_substr --  Cut out part of a string
iconv -- Konwertuje łańcuch znaków do innego zestawu znaków
ob_iconv_handler -- Konwersja kodowania znaków jako uchwyt buforu wyjścia