1NE_STRPARAM(3) neon API reference NE_STRPARAM(3)
2
3
4
6 ne_strparam - HTTP extended parameter value encoding
7
9 #include <ne_string.h>
10
11 char *ne_strparam(const char *charset, const char *lang,
12 const char *value);
13
15 The ne_strparam function can be used to encode an extended parameter
16 value for an HTTP header, as defined in RFC 5987. The function takes as
17 arguments the value to encode, using a given MIME charset character
18 set, and lang language tag. The extended parameter encoding is used in
19 HTTP protocol specifications to allow easily embedding special
20 characters (such as quote marks, separators or non-ASCII) in header
21 values.
22
23 In accordance with RFC 5987, the charset argument must be either
24 "UTF-8" or "IS0-8859-1", but the lang argument may be NULL.
25
27 The return value is either:
28
29 NULL
30 if the value parameter is a "regular parameter" and does not need
31 extended encoding
32
33 non-NULL
34 the encoding of the input value as an extended parameter as a
35 NUL-terminated, malloc-allocated string
36
38 https://tools.ietf.org/html/rfc5987
39
41 Joe Orton
42 Author.
43
45neon 0.32.5 21 January 2023 NE_STRPARAM(3)