1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-25 16:22:18 +01:00
Files
archived-doc-ru/reference/mbstring/functions/mb-check-encoding.xml
Mikhail Alferov 4de7917c25 Обновление перевода (#706)
Co-authored-by: Sergey Panteleev <sergey@php.net>
2024-01-15 18:33:18 +03:00

123 lines
4.0 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: d2ff0abe1650703e8974acaa7674c678e587a696 Maintainer: tmn Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.mb-check-encoding" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mb_check_encoding</refname>
<refpurpose>Проверяет, допустима ли строка для заданной кодировки</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>mb_check_encoding</methodname>
<methodparam choice="opt"><type class="union"><type>array</type><type>string</type><type>null</type></type><parameter>value</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>
Проверяет, допустим ли заданный поток байтов для заданной кодировки.
Если значение параметра <parameter>value</parameter> — массив (&array;), то все ключи и значения
проверяются рекурсивно.
Функция полезна для предотвращения атаки, которая называется «Атака
неправильной кодировкой».
</para>
<para>
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
Поток байтов или массив (&array;) для проверки. Если не задан, функция проверит все входные
данные с начала запроса.
</para>
<warning>
<para>
Начиная с PHP 8.1.0 пропуск этого параметра или передача значения &null; устарели.
</para>
</warning>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>encoding</parameter></term>
<listitem>
<para>
Ожидаемая кодировка.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.1.0</entry>
<entry>
Вызов функции с &null; в качестве параметра <parameter>value</parameter> или без аргумента устарело.
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
Параметры <parameter>value</parameter> и <parameter>encoding</parameter> могут
принимать значение &null;.
</entry>
</row>
<row>
<entry>7.2.0</entry>
<entry>
Функция теперь также принимает массив (&array;) в <parameter>value</parameter>.
Ранее поддерживались только строки (&string;).
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->