NE_STRPARAM(3)

πŸ’… NE_STRPARAM(3) β€” like, the neon API reference bestie ✨

okay so this is ne_strparam from the neon API reference, and honestly? she's lowkey iconic for doing exactly one job and doing it flawlessly. πŸŽ€


🌸 NAME 🌸

ne_strparam β€” HTTP extended parameter value encoding. periodt, that's the whole vibe. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <ne_string.h>

char *ne_strparam(const char *charset, const char *lang,
                  const char *value);

like, that's the signature, copy it exactly bestie, I'm begging πŸ™ˆ


πŸ’– DESCRIPTION πŸ’–

okay so the way that ne_strparam works is that it encodes an extended parameter value for an HTTP header, exactly as defined in RFC 5987 πŸ“œ. She takes these arguments: the value you wanna encode, the MIME charset character set to use, and a lang language tag. The whole extended parameter encoding thing exists in HTTP protocol specs so you can embed special characters β€” think quote marks, separators, or straight-up non-ASCII β€” into header values without it being a whole crisis. no cap, it's giving "let me handle that for you" πŸ’…

In accordance with RFC 5987, the charset argument must be either "UTF-8" or "IS0-8859-1" β€” yes, that's literally how it's spelled in the page, keep it exactly as-is, don't @ me 😭 β€” but the lang argument may be NULL. fr fr, NULL is fine there.


✨ RETURN VALUE ✨

so the return value is one of these two things, and you gotta know which is which:

  • NULL β€” this happens if the value parameter is a "regular parameter" and genuinely does not need extended encoding. she looked at it, said "you're fine as you are", and dipped 🫢
  • non-NULL β€” this is the encoding of the input value as an extended parameter, handed back as a NUL-terminated, malloc-allocated string. so yeah, it's yours now, you own that memory, bestie πŸ’€

πŸ•°οΈ HISTORY πŸ•°οΈ

ne_strparam is available in neon 0.32.0 and later. so if you're on something older... girl. upgrade. πŸ”₯


πŸ‘€ SEE ALSO πŸ‘€


Copyright © 2001-2026 Joe Orton 🌸


and that's the whole page!! 🧚 mwah, go encode something cute πŸ’œ

⭐ neon Β· 03/20/2026 Β· signing off, bestie, you got this πŸŽ€

πŸ“¦ where this page comes from