Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions appendices/migration84/incompatible.xml
Original file line number Diff line number Diff line change
Expand Up @@ -517,19 +517,19 @@
<title>MBString</title>

<simpara>
On invalid strings (those with encoding errors),
<function>mb_substr</function> now interprets character indices in the same
manner as most other mbstring functions.
As of PHP 8.3.2, on invalid strings (those with encoding errors),
<function>mb_substr</function> and <function>mb_strstr</function> interpret
character indices in the same manner as most other mbstring functions.
This means that character indices returned by <function>mb_strpos</function>
can be passed to <function>mb_substr</function>.
</simpara>

<simpara>
For SJIS-Mac (MacJapanese) strings, character indices passed to
<function>mb_substr</function> now refer to the indices of the Unicode
codepoints which are produced when the string is converted to Unicode.
This is significant because around 40 SJIS-Mac characters convert to a
sequence of multiple Unicode codepoints.
For <literal>SJIS-mac</literal> (MacJapanese) strings, those character
indices refer to the indices of the Unicode codepoints which are produced
when the string is converted to Unicode, which differ from the character
indices for the <literal>SJIS-mac</literal> characters that convert to a
sequence of several codepoints.
</simpara>
</sect2>

Expand Down
19 changes: 12 additions & 7 deletions reference/mbstring/book.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,19 @@
the multibyte character and ends up with a corrupted garbage string that
most likely loses its original meaning.
</para>
<para>
<literal>mbstring</literal> provides multibyte specific string functions
that help you deal with multibyte encodings in PHP. In addition to that,
<literal>mbstring</literal> handles character encoding conversion between
the possible encoding pairs. <literal>mbstring</literal> is designed to
handle Unicode-based encodings such as UTF-8 and UCS-2 and many
<simpara>
<literal>mbstring</literal> provides multibyte specific string functions
that help you deal with multibyte encodings in PHP. In addition to that,
<literal>mbstring</literal> handles character encoding conversion between
the possible encoding pairs. <literal>mbstring</literal> is designed to
handle Unicode-based encodings such as UTF-8 and UCS-2 and many
single-byte encodings for convenience (listed in <link linkend="mbstring.supported-encodings">Supported Character Encodings</link>).
</para>
</simpara>
<simpara>
The Unicode data tables used by <literal>mbstring</literal> have been
updated to Unicode 16.0 as of PHP 8.4.0, and to Unicode 17.0 as of
PHP 8.5.0.
</simpara>
</preface>
<!-- }}} -->

Expand Down
10 changes: 10 additions & 0 deletions reference/mbstring/functions/mb-strstr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@
</row>
</thead>
<tbody>
<row>
<entry>8.3.2</entry>
<entry>
On invalid strings (those with encoding errors) and on
<literal>SJIS-mac</literal> (MacJapanese) strings, the portion of
<parameter>haystack</parameter> returned when
<parameter>before_needle</parameter> is &true; is now determined from
the same character indices as the other mbstring functions.
</entry>
</row>
&mbstring.changelog.needle-empty;
&mbstring.changelog.encoding-nullable;
</tbody>
Expand Down
17 changes: 10 additions & 7 deletions reference/mbstring/functions/mb-substr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,17 @@
</thead>
<tbody>
<row>
<entry>8.4.0</entry>
<entry>8.3.2</entry>
<entry>
On invalid strings (those with encoding errors),
character indices are now interpreted in the same manner as most
other mbstring functions. This means that character indices returned
by <function>mb_strpos</function> can be passed directly.
For <literal>SJIS-mac</literal> (MacJapanese) strings, character
indices now refer to the indices of the Unicode codepoints produced
when the string is converted to Unicode, which differ from the
character indices for the <literal>SJIS-mac</literal> characters that
convert to a sequence of several codepoints.
</entry>
</row>
&mbstring.changelog.encoding-nullable;
Expand All @@ -114,12 +119,10 @@

<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mb_strcut</function></member>
<member><function>mb_internal_encoding</function></member>
</simplelist>
</para>
<simplelist>
<member><function>mb_strcut</function></member>
<member><function>mb_internal_encoding</function></member>
</simplelist>
</refsect1>

</refentry>
Expand Down