From 87378b434257afe0d4ffb4093eafa6282e0d2ec8 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 2 Aug 2026 17:33:02 +0900 Subject: feat(php-shim): implement HTTP last-response-headers store and ASCII mb_check_encoding http_get_last_response_headers()/http_clear_last_response_headers() now back a thread-local store with a recording hook for the (still unported) HTTP stream layer; with no request recorded they return None, matching PHP. mb_check_encoding gains the trivial ASCII arm; other encodings still need the mbstring tables and stay todo!(). Co-Authored-By: Claude Fable 5 --- crates/shirabe-php-shim/src/string.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crates/shirabe-php-shim/src/string.rs') diff --git a/crates/shirabe-php-shim/src/string.rs b/crates/shirabe-php-shim/src/string.rs index d793082d..fcf7baf2 100644 --- a/crates/shirabe-php-shim/src/string.rs +++ b/crates/shirabe-php-shim/src/string.rs @@ -369,6 +369,8 @@ pub fn mb_check_encoding(_value: &str, _encoding: &str) -> bool { match _encoding.to_ascii_uppercase().replace('-', "").as_str() { // A Rust &str is, by construction, valid UTF-8. "UTF8" => true, + "ASCII" | "USASCII" => _value.is_ascii(), + // Other encodings need the mbstring validation tables, which have not been ported. _ => todo!(), } } -- cgit v1.3.1