|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-09-15 16:22 UTC] svn@php.net
[2009-11-13 22:14 UTC] vrana@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Jun 15 13:00:02 2026 UTC |
Description: ------------ The documentation for mb_detect_encoding() fails to note that FALSE is a possible return value from the function if no encoding can be detected. This can be demonstrated trivially with the reproduce code below, and is obviously intended behaviour, looking at ext/mbstring/mbstring.c and ext/mbstring/libmbfl/mbfl/mbfilter.c. My suggestion would be to replace the Return Values text with the following: "Returns the detected character encoding, or FALSE if the encoding cannot be detected from the given string." Reproduce code: --------------- <?php // On the off chance you want to see this in action, any high-bit // character in the input should return false in strict mode when // ASCII is the only possible encoding. var_dump(mb_detect_encoding("f??", "ASCII", true)); Expected result: ---------------- bool(false) Actual result: -------------- bool(false)