encodeComponent

fnstring encodeComponent(Char)(scope const(Char)[] uriComponent) if (isSomeChar!Char)

Encodes the UTF-8 string uriComponent into a URI and returns that URI. Any character not a letter, digit, or one of -_.!~*'() is escaped.