note 98756 deleted from function.fopen by danbrown

From: Date: Mon, 05 Jul 2010 16:05:44 +0000
Subject: note 98756 deleted from function.fopen by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-170717@lists.php.net to get a copy of this message
Note Submitter: muellMichZu at gmuell dot com ---- @ te at sky-networx dot de: the encoding part is wrong, i.e.: <?php if ($sEncoding = mb_detect_encoding($sData, 'auto', true) != $sCharset) $sData = mb_convert_encoding($sData, $sCharset, $sEncoding); ?> Variable $sEncoding is set to result of the comparison and hence to a boolean value. It probably works in your case, since your files are UTF-8 encoded by default. <?php if (($sEncoding = mb_detect_encoding($sData, 'auto', true)) != $sCharset) $sData = mb_convert_encoding($sData, $sCharset, $sEncoding); ?> however thanks for the generic function

« previous php.notes (#170717) next »