12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- '\" t
- .\" Title: ne_strparam
- .\" Author:
- .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
- .\" Date: 15 April 2025
- .\" Manual: neon API reference
- .\" Source: neon 0.34.2
- .\" Language: English
- .\"
- .TH "NE_STRPARAM" "3" "15 April 2025" "neon 0.34.2" "neon API reference"
- .\" -----------------------------------------------------------------
- .\" * Define some portability stuff
- .\" -----------------------------------------------------------------
- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- .\" http://bugs.debian.org/507673
- .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- .ie \n(.g .ds Aq \(aq
- .el .ds Aq '
- .\" -----------------------------------------------------------------
- .\" * set default formatting
- .\" -----------------------------------------------------------------
- .\" disable hyphenation
- .nh
- .\" disable justification (adjust text to left margin only)
- .ad l
- .\" -----------------------------------------------------------------
- .\" * MAIN CONTENT STARTS HERE *
- .\" -----------------------------------------------------------------
- .SH "NAME"
- ne_strparam \- HTTP extended parameter value encoding
- .SH "SYNOPSIS"
- .sp
- .ft B
- .nf
- #include <ne_string\&.h>
- .fi
- .ft
- .HP \w'char\ *ne_strparam('u
- .BI "char *ne_strparam(const\ char\ *" "charset" ", const\ char\ *" "lang" ", const\ char\ *" "value" ");"
- .SH "DESCRIPTION"
- .PP
- The
- \fBne_strparam\fR
- function can be used to encode an extended parameter value for an HTTP header, as defined in RFC 5987\&. The function takes as arguments the
- \fIvalue\fR
- to encode, using a given MIME
- \fIcharset\fR
- character set, and
- \fIlang\fR
- language tag\&. The extended parameter encoding is used in HTTP protocol specifications to allow easily embedding special characters (such as quote marks, separators or non\-ASCII) in header values\&.
- .PP
- In accordance with RFC 5987, the
- \fIcharset\fR
- argument must be either
- \fB"UTF\-8"\fR
- or
- \fB"IS0\-8859\-1"\fR, but the
- \fIlang\fR
- argument may be
- NULL\&.
- .SH "RETURN VALUE"
- .PP
- The return value is either:
- .PP
- NULL
- .RS 4
- if the value parameter is a "regular parameter" and does not need extended encoding
- .RE
- .PP
- non\-NULL
- .RS 4
- the encoding of the input value as an extended parameter as a NUL\-terminated, malloc\-allocated string
- .RE
- .SH "HISTORY"
- .PP
- \fBne_strparam\fR
- is available in neon 0\&.32\&.0 and later\&.
- .SH "SEE ALSO"
- .PP
- \m[blue]\fB\%https://tools.ietf.org/html/rfc5987\fR\m[]
- .SH "COPYRIGHT"
- .br
- Copyright \(co 2001-2024 Joe Orton
- .br
|