Skip to main content

percent_decode_bytes

Function percent_decode_bytes 

Source
pub fn percent_decode_bytes(input: &[u8], plus_as_space: bool) -> Vec<u8> 
Expand description

字节级百分号解码(Preserve 策略,分配 Vec

非法 % 序列按原字节保留;plus_as_spacetrue+ 解码为空格。 不做 UTF-8 校验,输入/输出均为字节序列, 用于 body 等不保证 UTF-8 的场景。

Preserve 策略下解码永不失败,故直接返回 Vec<u8>