[wp-trac] [WordPress Trac] #29717: wp_check_invalid_utf8 - pcre tricks and failsafes, +mb_convert_encoding, iconv fix, performance

WordPress Trac noreply at wordpress.org
Wed May 15 12:45:31 UTC 2024


#29717: wp_check_invalid_utf8 - pcre tricks and failsafes, +mb_convert_encoding,
iconv fix, performance
-------------------------------------------------+-------------------------
 Reporter:  askapache                            |       Owner:  pbearne
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Formatting                           |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback has-unit-     |     Focuses:
  tests                                          |  performance
-------------------------------------------------+-------------------------

Comment (by Cyrille37):

 Hello

 With WP 6.5.2

 {{{
 PHP Notice:  iconv(): Detected an illegal character in input string
 in /.../wordpress/wp-includes/formatting.php on line 1141
 }}}

 in wp-include/formatting.php line 1141

 {{{#!php
 // Attempt to strip the bad chars if requested (not recommended).
 if ( $strip && function_exists( 'iconv' ) ) {
   return iconv( 'utf-8', 'utf-8', $text );
 }
 }}}

 If the aim is to "**Attempt to strip the bad chars**" perhaps changing to
 "utf-8//IGNORE" or "utf-8//IGNORE" will do the job ?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/29717#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list