aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim/src/string.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-02 17:33:02 +0900
committernsfisis <nsfisis@gmail.com>2026-08-02 17:33:02 +0900
commit87378b434257afe0d4ffb4093eafa6282e0d2ec8 (patch)
treef04b9a08dcfa78de3d94d7482df246f74904451e /crates/shirabe-php-shim/src/string.rs
parent7e31bab9ff7209c9b6d7928a581d7a449846f42e (diff)
downloadphp-shirabe-87378b434257afe0d4ffb4093eafa6282e0d2ec8.tar.gz
php-shirabe-87378b434257afe0d4ffb4093eafa6282e0d2ec8.tar.zst
php-shirabe-87378b434257afe0d4ffb4093eafa6282e0d2ec8.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim/src/string.rs')
-rw-r--r--crates/shirabe-php-shim/src/string.rs2
1 files changed, 2 insertions, 0 deletions
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!(),
}
}