Hi all, iconv("UTF-8","UTF-8//IGNORE",$txt) returns Unknown error type: [8] iconv() [function.iconv]: Detected an illegal character in input string... in line XX of file XX.php Why ? //IGNORE should take care of that, shouldn't it?
NO! //IGNORE can only be used in PHP itself and not in functions, classes or other methods! if () { // IGNORE is ok if (function("//IGNORE")) { is NOT ok coz its seen as text!
So we can't use IGNORE with iconv? Is there a way to fix corrupted utf-8 text without warnings ? (simply ignoring invalid characters ) ? Also , there are examples of using iconv with IGNORE at php.net : http://www.php.net/manual/en/function.iconv.php And, on my local system, it does work (I have libiconv implementation) On production server, there is glibc implementation and doesn't work