Skip to main content

iis_unicode_encode

Function iis_unicode_encode 

Source
pub fn iis_unicode_encode(payload: &str) -> String
Expand description

IIS/ASP percent Unicode encoding — each character becomes %uXXXX.

Context: ONLY safe on IIS/ASP classic parsers. IIS %u encoding is bounded to BMP (U+0000–U+FFFF) — non-BMP code points must be emitted as UTF-16 surrogate pairs (%uD83D%uDE00 for 😀, NOT the invalid %u1F600). Pre-fix the loop wrote ch as u32 straight into a 4-hex-wide format, silently truncating high bytes for any supplementary plane char and producing output IIS rejects — which looked encoded but bypassed nothing.