From 73f6fe8e052b7a2e3455a2b470b066af24b77be8 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 10 May 2023 23:56:44 +0100 Subject: [PATCH] codec/url.3: Add missing documentation for the `URLF_SEMI' flag. --- codec/url.3 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/codec/url.3 b/codec/url.3 index 4e8aa71..7f6bcf0 100644 --- a/codec/url.3 +++ b/codec/url.3 @@ -77,6 +77,12 @@ obviously-unsafe characters like and .RB ` = ' are left unescaped. +.TP +.B URLF_SEMI +Use a semicolon +.RB ` ; ' +to separate name/value pairs, rather than the ampersand +.RB ` & '. .PP Decoding a sequence of name/value pairs is performed using the .B url_dec @@ -98,6 +104,26 @@ so you probably want to reset them before each call. If there are no more name/value pairs to read, .B url_dec returns zero; otherwise it returns a nonzero value. +.PP +You can set flags in the encoding context's +.B f +member: +.TP +.B URLF_SEMI +Allow a semicolon +.RB ` ; ' +to separate name/value pairs, +.I in addition to +the ampersand +.RB ` & '. +Without this flag, the semicolon is considered an `ordinary' character +which can appear unescaped as part of names and values. (Note the +difference from the same flag's meaning when encoding. When encoding, +it +.I forces +the use of the semicolon, and when decoding, it +.I permits +its use.) .SH EXAMPLE The example code below demonstrates converting between a symbol table and a urlencoded representation. The code is untested. -- 2.11.0