note 102510 added to function.mb-detect-encoding
[email protected] Fri, 18 Feb 2011 03:43:45 -0800
| Newsgroups | php.notes |
|---|---|
| Message-ID | <[email protected]> |
If you try to use mb_detect_encoding to detect whether a string is valid UTF-8, use the strict mode, it is pretty worthless otherwise.
<?php
$str = 'áéóú'; // ISO-8859-1
mb_detect_encoding($str, 'UTF-8'); // 'UTF-8'
mb_detect_encoding($str, 'UTF-8', true); // false
?>
----
Server IP: 69.147.83.197
Probable Submitter: 91.82.94.138 (proxied: 127.0.0.1)
----
Manual Page -- http://www.php.net/manual/en/function.mb-detect-encoding.php
Edit -- https://master.php.net/note/edit/102510
Del: integrated -- https://master.php.net/note/delete/102510/integrated
Del: useless -- https://master.php.net/note/delete/102510/useless
Del: bad code -- https://master.php.net/note/delete/102510/bad+code
Del: spam -- https://master.php.net/note/delete/102510/spam
Del: non-english -- https://master.php.net/note/delete/102510/non-english
Del: in docs -- https://master.php.net/note/delete/102510/in+docs
Del: other reasons-- https://master.php.net/note/delete/102510
Reject -- https://master.php.net/note/reject/102510
Search -- https://master.php.net/manage/user-notes.php