[wp-trac] [WordPress Trac] #11175: wp_check_invalid_utf8() should drop invalid utf-8 chars only instead of truncating string

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 25 00:24:46 UTC 2009


#11175: wp_check_invalid_utf8() should drop invalid utf-8 chars only instead of
truncating string
--------------------------+-------------------------------------------------
 Reporter:  sirzooro      |       Owner:  hakre                            
     Type:  defect (bug)  |      Status:  new                              
 Priority:  normal        |   Milestone:  3.0                              
Component:  Charset       |     Version:  2.9                              
 Severity:  normal        |    Keywords:  has-patch tested needs-unit-tests
--------------------------+-------------------------------------------------

Comment(by hakre):

 I think it's noteworthy to remind that ''wp_check_invalid_utf8()'' should
 not be used to check wether or not a string is a valid utf8 string. The
 function can lead to false results because it's broken.

 Use ''seems_utf8()'' to verify a string beign properly UTF8 encoded or
 not.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11175#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list