pctNormalizeTo

fnvoid pctNormalizeTo(R)(string s, Component comp, ref R dst) @safe

Write normalized percent-encoding of s for component comp to dst.

Decodes percent-encoded triplets that map to unreserved characters and uppercases hex digits in remaining percent-encoded octets. Does not validate or decode sequences that would introduce reserved characters that are not allowed by the comp context.

Parameters

sComponent string that may contain percent-escapes.
compURI component context.
dstOutput range that receives the normalized bytes.

Examples

import std.array : appender;
auto w = appender!string();
pctNormalizeTo("%7e%2f", Component.Path, w);
assert(w.data == "~%2F");