Template:PN2HTP

From Wiki

Jump to: navigation, search

Template PN2HTP converts a poll name to an encoded value suitable for use in an HTTP query parameter. The poll name is the full name of a poll page. The conversion is effected by replacing each slash '/' character with an exclamation mark '!'.[1] The result is given a standard URL encoding (underscores for spaces, and so forth), though this should have no effect given the restrictions on a poll name.

Usage

Example

{{PN2HTP | Tor/p/m}}

The result is:

Tor!p!m

References

  1. “Within a query component, the characters ';', '/', '?', ':', '@', '&', '=', '+', ',', and '$' are reserved.”* We wanted to encoded the '/' as one of these (explicitly) unreserved “mark” characters: '-', '_', '.', '!', '~', '*', ''', '(' or ')'.** We chose the '!' which is otherwise invalid in a poll name. On their side, vote-servers and other poll-name parsers must decode it to '/'.
Personal tools