Документация PHP


unicode_semantics

unicode_set_subst_char

Unicode Функции

PHP Manual


unicode_set_error_mode

(No version information available, might be only in CVS)

unicode_set_error_mode — Set the error mode for strings conversions

Описание

bool unicode_set_error_mode ( int $direction , int $mode )

This function sets the error mode for string conversions between different encodings. An error can occur during conversion when an illegal character is encountered or if a character cannot be represented into the new encoding. By default, when an error is encountered, the conversion stops.

Список параметров

direction

The direction sets the conversion direction to which the error mode will apply. This can either be FROM_UNICODE, which will set the error mode for conversions from a unicode string to a binary string or TO_UNICODE, which will set the error mode for conversions from a binary string to a unicode string.

mode

mode determines how the conversion errors are handled. It should be one of the following constants:

Available modes
Mode Description
U_CONV_ERROR_STOP Stop the conversion. This is the default mode.
U_CONV_ERROR_SKIP Skip the character.
U_CONV_ERROR_SUBST Substitute the character. The substituting character can be set with unicode_set_subst_char().
U_CONV_ERROR_ESCAPE_UNICODE Escape the faulty bytes and represent them in the Unicode character format.
U_CONV_ERROR_ESCAPE_ICU Escape the faulty bytes and represent them in the ICU character format.
U_CONV_ERROR_ESCAPE_JAVA Escape the faulty bytes and print them in the Java character format.
U_CONV_ERROR_ESCAPE_XML_DEC Escape the faulty bytes and represent them in decimal format.
U_CONV_ERROR_ESCAPE_XML_HEX Escape the faulty bytes and represent them in hexadecimal format.

Возвращаемые значения

Возвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки.

Errors/Exceptions

Emits a E_WARNING level error if the direction or the mode are invalid.

Примечания

Внимание

Эта функция является ЭКСПЕРИМЕНТАЛЬНОЙ. Поведение этой функции, ее имя и относящаяся к ней документация могут измениться в последующих версиях PHP без уведомления. Используйте эту функцию на свой страх и риск.

Смотрите также


unicode_semantics

unicode_set_subst_char

Unicode Функции

PHP Manual

SAPE все усложнил?

MainLink - простая и прибыльная продажа ссылок!

Последние поступления:

Размещена 10 августа 2020 года

Я по ТВ видел, что через 10 лет мы будем жить лучше, чем в Германии...
Я не понял, что это они с Германией сделать хотят?!

читать далее…

ТехЗадание на Землю

Размещена 14 марта 2018 года

Пpоект Genesis (из коpпоpативной пеpеписки)

читать далее…

Шпаргалка по работе с Vim

Размещена 05 декабря 2017 года

Vim довольно мощный редактор, но работа с ним не всегда наглядна.
Например если нужно отредактировать какой-то файл например при помощи crontab, без знания специфики работы с viv никак.

читать далее…

Ошибка: Error: Cannot find a valid baseurl for repo

Размещена 13 сентабря 2017 года

Если возникает ошибка на centos 5 вида
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/

читать далее…

Linux Optimization

Размещена 30 июля 2012 года

Prelink

читать далее…