|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-06-07 08:54 UTC] oylbqelmhfbxzg at mailinator dot com
Description: ------------ Since bug 36994 was closed.. Both $string = "test?" in a utf-8 text file, and $string = "test?" in an iso-8859-1 file (converted using iconv) return "UTF-8" with mb_detect_encoding, even when strict is on. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 25 15:00:01 2025 UTC |
Could you show me mbstring part of php.ini ? And please show me the simple script to verify your ploblem. I executed this tiny script, and if forks fine. (with Fedora Linux 5, PHP 5.1.5) <?php $string = "test?"; echo mb_detect_encoding($string,array('ISO-8859-1','UTF-8')); // returns ISO-8859-1 ?>I read that mb_detect_encoding($string,array('ISO-8859-1','UTF-8')); always return ISO-8859-1. Try this; <?php $string1 = "test?"; echo mb_detect_encoding($string1,'UTF-8, ISO-8859-1'); // returns UTF-8 echo " "; $string2 = "test?e"; echo mb_detect_encoding($string2,'UTF-8, ISO-8859-1'); // returns ISO-8859-1 ?> (php 4.4.0)