Skip to content

Commit aa51871

Browse files
committed
Add more details to NEWS on mb_detect_encoding; also include in UPGRADING
1 parent d64c718 commit aa51871

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

NEWS

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,17 @@ PHP NEWS
6969
. mb_detect_encoding is better able to identify the correct encoding for
7070
Turkish text. (Alex Dowad)
7171
. mb_detect_encoding's "non-strict" mode now behaves as described in the
72-
documentation. Previously, it would return false if the very first byte
73-
of the input string was invalid in all candidate encodings. (Alex Dowad)
72+
documentation. Previously, it would return false if the same byte
73+
(for example, the first byte) of the input string was invalid in all
74+
candidate encodings. More generally, it would eliminate candidate
75+
encodings from consideration when an invalid byte was seen, and if the
76+
same input byte eliminated all remaining encodings still under
77+
consideration, it would return false. On the other hand, if all candidate
78+
encodings but one were eliminated from consideration, it would return the
79+
last remaining one without regard for how many encoding errors might be
80+
encountered later in the string. This is different from the behavior
81+
described in the documentation, which says: "If strict is set to false,
82+
the closest matching encoding will be returned." (Alex Dowad)
7483
. mb_strtolower, mb_strtotitle, and mb_convert_case implement conditional
7584
casing rules for the Greek letter sigma. For mb_convert_case, conditional
7685
casing only applies to MB_CASE_LOWER and MB_CASE_TITLE modes, not to

UPGRADING

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ PHP 8.3 UPGRADE NOTES
107107
Underscores must be encoded as "=5F" in such MIME encoded words.
108108
. In rare cases, mb_encode_mimeheader will transfer-encode its input
109109
string where it would pass it through as raw ASCII in PHP 8.2.
110+
. mb_detect_encoding's "non-strict" mode now behaves as described in the
111+
documentation. Previously, it would return false if the same byte
112+
(for example, the first byte) of the input string was invalid in all
113+
candidate encodings. More generally, it would eliminate candidate
114+
encodings from consideration when an invalid byte was seen, and if the
115+
same input byte eliminated all remaining encodings still under
116+
consideration, it would return false. On the other hand, if all candidate
117+
encodings but one were eliminated from consideration, it would return the
118+
last remaining one without regard for how many encoding errors might be
119+
encountered later in the string. This is different from the behavior
120+
described in the documentation, which says: "If strict is set to false,
121+
the closest matching encoding will be returned."
110122

111123
- mysqli:
112124
. mysqli_fetch_object now raises a ValueError instead of an Exception when the constructor_args

0 commit comments

Comments
 (0)