Changes between Initial Version and Version 2 of Ticket #63837
- Timestamp:
- 08/19/2025 02:23:11 AM (12 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #63837
- Property Keywords has-patch has-unit-tests added
-
Ticket #63837 – Description
initial v2 8 8 9 9 The last point is inherent to how the function works, but the other points can be updated by relying on the newer `wp_is_valid_utf8()` and by providing a custom fallback method to strip out invalid byte sequences. 10 11 Improving clarity around this function involves removing the blurred line between determining if content is allegedly UTF-8 and handling it as if it is. A new function, `wp_scrub_utf8()`, can be used to produce a valid UTF-8 string formed by replacing invalid sequences of bytes with the Unicode replacement character U+FFFD (`�`). This behaves as `wp_check_invalid_bytes( $s, true )` //should// work if the `blog_charset` is `UTF-8`. 12 13 Ideally, data should be transformed //from// some encoding //into// `UTF-8` as soon as it enters WordPress and then code which previously called `wp_check_invalid_utf8()` can now call `wp_scrub_utf8()` //if// it truly needs to remove invalid bytes.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)