stringprep_4i(3)
π stringprep_4i(3) β the libidn glow-up page π
okay bestie, so this is stringprep_4i, a lil API function living in libidn (that's the manual we're in, mwah). It's giving "i prepare your Unicode string for you" and honestly? iconic.
β¨ SYNOPSIS β¨
#include <stringprep.h>
int stringprep_4i(uint32_t * ucs4, size_t * len, size_t maxucs4len,
Stringprep_profile_flags flags, const Stringprep_profile * profile);
π«Ά ARGUMENTS π«Ά
uint32_t * ucs4β the input/output array holding the string you wanna prepare. It goes in messy, it comes out ready. main character behavior fr.size_t * lenβ on input, this is the length of the input array, counted in Unicode code points. On exit, it's the length of the output array, also in Unicode code points. she changes, she grows, she evolves πsize_t maxucs4lenβ the max length of the input/output array. the ceiling. the limit. respect it.Stringprep_profile_flags flagsβ aStringprep_profile_flagsvalue, or0. that's it, that's the whole vibe.const Stringprep_profile * profileβ a pointer to theStringprep_profileyou want to use. pick your fighter π
πΈ DESCRIPTION πΈ
Prepare the input UCS-4 string according to the stringprep profile, and write the result right back into that same input string. in-place glow-up, no cap β¨
The input does not have to be zero terminated (ucs4 [ len ] = 0). And the output will not be zero terminated either β unless ucs4 [ len ] = 0, obviously. So if your input is zero terminated, or if you want your output to be, go peek at stringprep_4zi() instead, bestie. that one's for you π¦
Since the stringprep operation can expand the string, maxucs4len is there to tell everyone how big the buffer holding the string actually is. This function will not read or write to code points outside that size. boundaries!! we love them!! π§
The flags are one of the Stringprep_profile_flags values, or 0.
The profile contains the Stringprep_profile instructions that get performed. Your application can define brand new profiles β possibly reusing the generic stringprep tables that will always be part of the library, periodt β or just use one of the currently supported profiles. build your own or borrow someone's, both are valid π§
Return value: returns STRINGPREP_OK iff successful, or a Stringprep_rc error code. if it's not that, something's up π
π DESCRIPTION π (yes, again, she said it twice and she meant it twice)
Prepare the input UCS-4 string according to the stringprep profile, and write the result right back into that same input string. (in case you scrolled past the first one, i got you π)
The input does not have to be zero terminated (ucs4 [ len ] = 0). And the output will not be zero terminated either β unless ucs4 [ len ] = 0. So if your input is zero terminated, or if you want your output to be, see stringprep_4zi() instead.
Since the stringprep operation can expand the string, maxucs4len indicates how large the buffer holding the string is. This function will not read or write to code points outside that size.
The flags are one of Stringprep_profile_flags values, or 0.
The profile contains the Stringprep_profile instructions to perform. Your application can define new profiles, possibly reusing the generic stringprep tables that always will be part of the library, or use one of the currently supported profiles.
Return value: Returns STRINGPREP_OK iff successful, or an Stringprep_rc error code.
π REPORTING BUGS π
Found a bug? don't suffer in silence, 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/
fr fr, if something's broken, say something. the maintainers wanna know π«Ά
π 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.
like, copy it, remix it, share it with the group chat β just keep the notice, okay? that's the whole deal π
π¦ 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, this command:
info libidn
should give you access to the complete manual. And if that's not hitting, you can alternatively obtain the manual from:
https://www.gnu.org/software/libidn/manual/
and that's the tea, bestie π
this whole page came to you from libidn version 1.44 β go forth, prepare those strings, and stay zero-terminated (or don't, stringprep_4zi() has your back) β¨ππ¦
π¦ 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