fix: SET 原始值接收者按严格性分流并补脏重建本体标

This commit is contained in:
2026-09-24 19:37:26 +00:00
parent f9e6eb3b2b
commit 4787f2180f
9 changed files with 56 additions and 30 deletions
+5 -1
View File
@@ -24,7 +24,11 @@ fn encode_uri_units(input: &[u16], safe: &str) -> Result<String, ()> {
}
let cp = 0x10000 + ((unit as u32 - 0xD800) << 10) + (next as u32 - 0xDC00);
let mut buf = [0u8; 4];
for byte in char::from_u32(cp).expect("合成码点必在超平面区间内").encode_utf8(&mut buf).as_bytes() {
for byte in char::from_u32(cp)
.expect("合成码点必在超平面区间内")
.encode_utf8(&mut buf)
.as_bytes()
{
out.push_str(&format!("%{byte:02X}"));
}
i += 2;