Index: trunk/phase3/includes/DjVuImage.php |
— | — | @@ -251,7 +251,13 @@ |
252 | 252 | wfProfileOut( 'djvutxt' ); |
253 | 253 | if( $retval == 0) { |
254 | 254 | # Get rid of invalid UTF-8, strip control characters |
255 | | - $txt = UtfNormal::cleanUp( $txt ); |
| 255 | + if( is_callable( 'iconv' ) ) { |
| 256 | + wfSuppressWarnings(); |
| 257 | + $txt = iconv( "UTF-8","UTF-8//IGNORE", $txt ); |
| 258 | + wfRestoreWarnings(); |
| 259 | + } else { |
| 260 | + $txt = UtfNormal::cleanUp( $txt ); |
| 261 | + } |
256 | 262 | $txt = preg_replace( "/[\013\035\037]/", "", $txt ); |
257 | 263 | $txt = htmlspecialchars($txt); |
258 | 264 | $txt = preg_replace( "/\((page\s[\d-]*\s[\d-]*\s[\d-]*\s[\d-]*\s*\"([^<]*?)\"\s*|)\)/s", "<PAGE value=\"$2\" />", $txt ); |