EncodeNonUnreserved

Converts non-unreserved characters. Unreserved characters are the ASCII alphanumeric characters and

-._~

.

@see http://tools.ietf.org/html/rfc3986#section-2.3

Special cases:

- The whitespace character 0x20 is encoded as "%20" (not "+"). - Characters below 0x20 and above 0x7E are encoded straight away, regardless of any encoding or codepage. For example, the UTF-8 encoded string "Münzstraße", which corresponds to the byte sequence [0x4D, 0xC3, 0xBC, 0x6E, 0x7A, 0x73, 0x74, 0x72, 0x61, 0xC3, 0x9F, 0x65] ...M .........ü ....n ...z ...s ...t ...r ...a .........ß ...e , is encoded as "M%C3%BCnzstra%C3%9Fe".

UrlEncoder class

Memory friendly, suitable for stack-allocated 'scope' instances.

Constructors

this
this(cstring source_in)

Constructor

Members

Functions

encode
bool encode(char c)

Tells whether c should be converted.

Static variables

unreserved
bool[char.max + 1] unreserved;

Character map, true for unreserved characters.

Inherited Members

From PercentEncoder

source
cstring source;

Source string, may be changed at any time except during encoding 'foreach' iteration.

opApply
int opApply(int delegate(ref cstring chunk) dg)

Encodes this.source in an 'foreach' iteration over encoded chunks. Each chunk is guaranteed not to be empty.

encode
bool encode(char c)

Encodes all characters except the ASCII graphic, that is, encodes ASCII whitespace and control characters and non-ASCII characters.

Meta