IA*M&R$Ei\Z-$j$8=%ɳw$$c)# $E/** * Finds spans of valid and invalid UTF-8 bytes in a given string. * * This is a low-level tool to power various UTF-8 functionality. * It scans through a string until it finds invalid byte spans. * When it does this, it does three things: * * - Assigns `$at` to the position after the last successful code point. * - Assigns `$invalid_length` to the length of the maximal subpart of * the invalid bytes starting at `$at`. * - Returns how many code points were successfully scanned. * * This information is enough to build a number of useful UTF-8 functions. * * Example: * * // ñ is U+F1, which in `ISO-8859-1`/`latin1`/`Windows-1252`/`cp1252` is 0xF1. * "Pi\xF1a" === $pineapple = mb_convert_encoding( "Piña", 'Windows-1252', 'UTF-8' ); * $at = $invalid_length = 0; * * // The first step finds the invalid 0xF1 byte. * 2 === _wp_scan_utf8( $pineapple, $at, $invalid_length ); * $at === 2; $invalid_length === 1; * * // The second step continues to the end of the string. * 1 === _wp_scan_utf8( $pineapple, $at, $invalid_length ); * $at === 4; $invalid_length === 0; * * Note! While passing an options array here might be convenient from a calling-code standpoint, * this function is intended to serve as a very low-level foundation upon which to build * higher level functionality. For the sake of keeping costs explicit all arguments are * passed directly. * * @since 6.9.0 * @access private * * @param string $bytes UTF-8 encoded string which might include invalid spans of bytes. * @param int $at Where to start scanning. * @param int $invalid_length Will be set to how many bytes are to be ignored after `$at`. * @param int|null $max_bytes Stop scanning after this many bytes have been seen. * @param int|null $max_code_points Stop scanning after this many code points have been seen. * @param bool|null $has_noncharacters Set to indicate if scanned string contained noncharacters. * @return int How many code points were successfully scanned. */a$a$آ$ $a$a$آ$@ $a$a$آ$ ' $a$a$آ$h $a$a$آ$0 $a$a$آ$ $a$a$itP?tP3tPlt` ltpƭtP yt ltt*?t=tPPuVt``At`putPӱtPtptp`+t`t*?t`=tP`Q/tPAtӱt?t`=tt /tPAtӱt?t``=tP t@ /tPAt ӱt ?t =tPPutp`ut`p@/t@pAtPtPttp5tpet`"Stp`t`"t,tp t@+ntP>?tp(=tPPutp`uttnt>t > 9P`t$B@@?`?`?`P8 $a$a$آ$ $a$a$آ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