Files
Nicolas Grekas e58c1910a7 ext/standard: Check for UTF-8 first when resolving the charset of html functions (#23961)
determine_charset() ran strlen() and walked the charset map with case-insensitive
compares on every call, while "UTF-8" (explicit or from default_charset) is what
nearly every call asks for. It now checks for "utf-8" in any case first, and moves
the walk to a separate function.

The codesets of the charset map are now lowercase. The walk lowercases the hint once,
then compares the length and the first byte before calling memcmp(), so other charsets
resolve faster too. The "utf-8" entry of the charset map is removed, since the walk
can no longer reach it.
2026-10-14 19:20:34 +02:00
..