stringprep(3)
π stringprep(3) β bestie edition π
okay so this is a page from the libidn manual (that's the GNU one, the internationalized-domain-names girlies π¦), and it's about one single function that fixes up your strings so they behave. strap in.
β¨ NAME β¨
stringprep β it's an API function, and it's the main character π
πΈ SYNOPSIS πΈ
#include <stringprep.h>
int stringprep(char * in, size_t maxlen, Stringprep_profile_flags flags,
const Stringprep_profile * profile);
literally one include and one call, we love a low-effort baddie π
π«Ά ARGUMENTS π«Ά
char * inβ the input/output array, and yes bestie it's holding the string you wanna prepare. in AND out, it does both, she's versatile πsize_t maxlenβ the maximum length of that input/output array. think of it as the vibe check on how much room she has πStringprep_profile_flags flagsβ aStringprep_profile_flagsvalue, or0. that's it. that's the options.const Stringprep_profile * profileβ a pointer to theStringprep_profileyou wanna use β¨
π DESCRIPTION π
So what does she actually DO. She prepares the input zero terminated UTF-8 string according to the stringprep profile, and then writes the result back into the input string. yes, in place. she's efficient like that π₯
heads up bestie: you must convert strings that came in from the system's locale into UTF-8 before you use this function. there's a whole other function for that, stringprep_locale_to_utf8(). don't skip that step, i'm begging π
and because the stringprep operation can expand the string, maxlen is there to tell her how large the buffer holding the string actually is. she will not read or write to characters outside that size. she respects the boundary, we stan a queen with limits π
the flags are one of the Stringprep_profile_flags values, or 0. (yes, again, or 0, she's not picky π)
the profile contains the Stringprep_profile instructions to perform. and here's the fun part β your application can define new profiles, possibly reusing the generic stringprep tables that will always be part of the library, or you can just use one of the currently supported profiles. build your own or pick off the rack, both slay π
Return value: she returns STRINGPREP_OK iff successful, or an error code. iff!! the mathematicians are quaking β
π REPORTING BUGS π
found a bug? don't suffer in silence bestie, tell the people:
- Report bugs to
<help-libidn@gnu.org>. - General guidelines for reporting bugs: https://www.gnu.org/gethelp/
- GNU Libidn home page: https://www.gnu.org/software/libidn/
π COPYRIGHT π
Copyright Β© 2002-2026 Simon Josefsson.
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
(so like, take it, share it, remix it, just keep the receipts π§)
π SEE ALSO π
The full documentation for libidn is maintained as a Texinfo manual. If the info and libidn programs are properly installed at your site, the command
info libidn
should give you access to the complete manual. As an alternative you may obtain the manual from:
https://www.gnu.org/software/libidn/manual/
okay that's the whole page, you ate it, no crumbs πβ¨ this was libidn version 1.44, stringprep(3), and she's been serving since way back. go forth and prepare your strings responsibly, bestie π¦πΈ
π¦ where this page comes from
- arch rolling: libidn 1.44-1 Β· GPL3 AND LGPL
- epel 10: libidn-devel 1.44-1.el10_3 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 43: libidn-devel 1.44-1.fc43 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 43: libidn-devel 1.44-1.fc43 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: libidn-devel 1.44-1.fc44 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: libidn-devel 1.44-1.fc44 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- ubuntu stonking: libidn-dev 1.44-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms