wp_check_invalid_utf8() should drop invalid utf-8 chars only instead of truncating string
|Reported by:||sirzooro||Owned by:||hakre|
|Component:||Charset||Keywords:||has-patch tested needs-unit-tests dev-feedback|
When you call wp_check_invalid_utf8() with 2nd param set to true, it tries to strip invalid utf-8. Now it removes 1st invalid utf-8 char and all chars after it, no matter if they are correct or not. Additionally it can print following notice:
Notice: iconv() [function.iconv]: Detected an illegal character in input string in .../wp-includes/formatting.php on line 437
Attached patch changes this, so function removes invalid chars only. Additionally it is less configuration-dependent, because it can use either mb_convert_encoding() or iconv().