WordPress.org

Make WordPress Core

Ticket #11175: formatting.php.diff

File formatting.php.diff, 557 bytes (added by sirzooro, 9 years ago)
  • formatting.php

    old new  
    433433        }
    434434
    435435        // Attempt to strip the bad chars if requested (not recommended)
    436         if ( $strip && function_exists( 'iconv' ) ) {
    437                 return iconv( 'utf-8', 'utf-8', $string );
     436        if ( $strip ) {
     437                if ( function_exists( 'mb_convert_encoding' ) ) {
     438                        return mb_convert_encoding( $string, 'utf-8', 'utf-8' );
     439                }
     440                if ( function_exists( 'iconv' ) ) {
     441                        return iconv( 'utf-8', 'utf-8//ignore', $string );
     442                }
    438443        }
    439444
    440445        return '';