ne_strparam.3 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. '\" t
  2. .\" Title: ne_strparam
  3. .\" Author:
  4. .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
  5. .\" Date: 15 April 2025
  6. .\" Manual: neon API reference
  7. .\" Source: neon 0.34.2
  8. .\" Language: English
  9. .\"
  10. .TH "NE_STRPARAM" "3" "15 April 2025" "neon 0.34.2" "neon API reference"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. ne_strparam \- HTTP extended parameter value encoding
  32. .SH "SYNOPSIS"
  33. .sp
  34. .ft B
  35. .nf
  36. #include <ne_string\&.h>
  37. .fi
  38. .ft
  39. .HP \w'char\ *ne_strparam('u
  40. .BI "char *ne_strparam(const\ char\ *" "charset" ", const\ char\ *" "lang" ", const\ char\ *" "value" ");"
  41. .SH "DESCRIPTION"
  42. .PP
  43. The
  44. \fBne_strparam\fR
  45. 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
  46. \fIvalue\fR
  47. to encode, using a given MIME
  48. \fIcharset\fR
  49. character set, and
  50. \fIlang\fR
  51. 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\&.
  52. .PP
  53. In accordance with RFC 5987, the
  54. \fIcharset\fR
  55. argument must be either
  56. \fB"UTF\-8"\fR
  57. or
  58. \fB"IS0\-8859\-1"\fR, but the
  59. \fIlang\fR
  60. argument may be
  61. NULL\&.
  62. .SH "RETURN VALUE"
  63. .PP
  64. The return value is either:
  65. .PP
  66. NULL
  67. .RS 4
  68. if the value parameter is a "regular parameter" and does not need extended encoding
  69. .RE
  70. .PP
  71. non\-NULL
  72. .RS 4
  73. the encoding of the input value as an extended parameter as a NUL\-terminated, malloc\-allocated string
  74. .RE
  75. .SH "HISTORY"
  76. .PP
  77. \fBne_strparam\fR
  78. is available in neon 0\&.32\&.0 and later\&.
  79. .SH "SEE ALSO"
  80. .PP
  81. \m[blue]\fB\%https://tools.ietf.org/html/rfc5987\fR\m[]
  82. .SH "COPYRIGHT"
  83. .br
  84. Copyright \(co 2001-2024 Joe Orton
  85. .br