pctDecode

fnstring pctDecode(string s) @safe

Decode percent-encoded triplets in s.

Decodes valid %HH escape sequences where H is a hexadecimal digit. Invalid or incomplete sequences (e.g., %GZ, `%`, %1) are left unchanged, following RFC 3986 recommendations for lenient parsing.

Decoding is performed byte-wise and does not validate UTF-8 multibyte sequences. Call std.utf.validate on the result if UTF-8 validation is needed.

Parameters

sString that may contain %HH escape sequences.

Returns

A string with valid %HH escapes decoded to bytes.