pike.git / lib / modules / Protocols.pmod / HTTP.pmod / module.pmod

version» Context lines:

pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:769:   protected local constant other_chars =    (string) enumerate (0x20) + "\x7f" // Control chars    " \"<>\\^`{|}";      protected local constant eight_bit_chars = (string) enumerate (0x80, 1, 0x80);      string percent_encode (string s)   //! Encodes the given string using @tt{%XX@} encoding, except that URI   //! unreserved chars are not encoded. The unreserved chars are   //! @tt{A-Z@}, @tt{a-z@}, @tt{0-9@}, @tt{-@}, @tt{.@}, @tt{_@}, and - //! @tt{~@} (see RFC 2396 section 2.3). + //! @tt{~@} (see @rfc{2396@} section 2.3).   //!   //! 8-bit chars are encoded straight, and wider chars are not allowed.   //! That means this encoding is applicable if @[s] is a binary octet   //! string. If it is a character string then @[uri_encode] should be   //! used instead.   //!   //! It is also slightly faster than @[uri_encode] if @[s] is known to   //! contain only US-ASCII.   {    constant replace_chars = (gen_delims + sub_delims +
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:809:   //! is necessary to work as the reverse of @[iri_encode].   {    return _Roxen.http_decode_string (s);   }      string uri_encode (string s)   //! Encodes the given string using @tt{%XX@} encoding to be used as a   //! component part in a URI. This means that all URI reserved and   //! excluded characters are encoded, i.e. everything except @tt{A-Z@},   //! @tt{a-z@}, @tt{0-9@}, @tt{-@}, @tt{.@}, @tt{_@}, and @tt{~@} (see - //! RFC 2396 section 2.3). + //! @rfc{2396@} section 2.3).   //!   //! 8-bit chars and wider are encoded using UTF-8 followed by - //! percent-encoding. This follows RFC 3986 section 2.5, the - //! IRI-to-URI conversion method in the IRI standard (RFC 3987) and + //! percent-encoding. This follows @rfc{3986@} section 2.5, the + //! IRI-to-URI conversion method in the IRI standard (@rfc{3987@}) and   //! appendix B.2 in the HTML 4.01 standard. It should work regardless   //! of the charset used in the XML document the URI might be inserted   //! into.   //!   //! @seealso   //! @[uri_decode], @[uri_encode_invalids], @[iri_encode]   {    return percent_encode (string_to_utf8 (s));   }      string uri_encode_invalids (string s)   //! Encodes all "dangerous" chars in the given string using @tt{%XX@}   //! encoding, so that it can be included as a URI in an HTTP message   //! or header field. This includes control chars, space and various - //! delimiter chars except those in the URI @tt{reserved@} set (RFC - //! 2396 section 2.2). + //! delimiter chars except those in the URI @tt{reserved@} set + //! (@rfc{2396@} section 2.2).   //!   //! Since this function doesn't touch the URI @tt{reserved@} chars nor   //! the escape char @tt{%@}, it can be used on a complete formatted   //! URI or IRI.   //!   //! 8-bit chars and wider are encoded using UTF-8 followed by - //! percent-encoding. This follows RFC 3986 section 2.5, the IRI - //! standard (RFC 3987) and appendix B.2 in the HTML 4.01 standard. + //! percent-encoding. This follows @rfc{3986@} section 2.5, the IRI + //! standard (@rfc{3987@}) and appendix B.2 in the HTML 4.01 standard.   //!   //! @note   //! The characters in the URI @tt{reserved@} set are: @tt{:@},   //! @tt{/@}, @tt{?@}, @tt{#@}, @tt{[@}, @tt{]@}, @tt{@@@}, @tt{!@},   //! @tt{$@}, @tt{&@}, @tt{'@}, @tt{(@}, @tt{)@}, @tt{*@}, @tt{+@},   //! @tt{,@}, @tt{;@}, @tt{=@}. In addition, this function doesn't   //! touch the escape char @tt{%@}.   //!   //! @seealso   //! @[uri_decode], @[uri_encode]
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:873:    // Note: This currently does not quite work for URI-to-IRI    // conversion according to RFC 3987 section 3.2. Most importantly    // any invalid utf8-sequences should be left percent-encoded in the    // result.    return utf8_to_string (_Roxen.http_decode_string (s));   }      string iri_encode (string s)   //! Encodes the given string using @tt{%XX@} encoding to be used as a   //! component part in an IRI (Internationalized Resource Identifier, - //! see RFC 3987). This means that all chars outside the IRI + //! see @rfc{3987@}). This means that all chars outside the IRI   //! @tt{iunreserved@} set are encoded, i.e. this function encodes   //! equivalently to @[uri_encode] except that all 8-bit and wider   //! characters are left as-is.   //!   //! @bugs   //! This function currently does not encode chars in the Unicode   //! private ranges, although that is strictly speaking required in   //! some but not all IRI components. That could change if it turns out   //! to be a problem.   //!
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:931: Inside #if 0
  //! @seealso   //! @[iri_decode], @[uri_normalize]   {    // FIXME   }      #endif      string quoted_string_encode (string s)   //! Encodes the given string quoted to be used as content inside a - //! @tt{quoted-string@} according to RFC 2616 section 2.2. The + //! @tt{quoted-string@} according to @rfc{2616@} section 2.2. The   //! returned string does not include the surrounding @tt{"@} chars.   //!   //! @note - //! The @tt{quoted-string@} quoting rules in RFC 2616 have several + //! The @tt{quoted-string@} quoting rules in @rfc{2616@} have several   //! problems:   //!   //! @ul   //! @item   //! Quoting is inconsistent since @tt{"@} is quoted as @tt{\"@}, but   //! @tt{\@} does not need to be quoted. This is resolved in the HTTP   //! bis update to mandate quoting of @tt{\@} too, which this   //! function performs.   //!   //! @item
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:959:   //! @endul   //!   //! @seealso   //! @[quoted_string_decode]   {    return replace (s, (["\"": "\\\"", "\\": "\\\\"]));   }      string quoted_string_decode (string s)   //! Decodes the given string which has been encoded as a - //! @tt{quoted-string@} according to RFC 2616 section 2.2. @[s] is + //! @tt{quoted-string@} according to @rfc{2616@} section 2.2. @[s] is   //! assumed to not include the surrounding @tt{"@} chars.   //!   //! @seealso   //! @[quoted_string_encode]   {    return map (s / "\\\\", replace, "\\", "") * "\\";   }