gsasl_stringprep_nfkc(3)
π gsasl_stringprep_nfkc β bestie, we're normalizing π
okay so real talk, this is a page from the GNU SASL manual, and the function in question is gsasl_stringprep_nfkc(3). she's an API function. and bestieβ¦ she's deprecated, but we'll get to that. sit down, hydrate, we're doing Unicode today π¦
β¨ SYNOPSIS β¨
#include <gsasl.h>
char * gsasl_stringprep_nfkc(const char * in, ssize_t len);
π ARGUMENTS π
const char * inβ a UTF-8 encoded string. that's the thing you're feeding her.ssize_t lenβ the length ofstr, in bytes. or, and this is the cute part,-1ifstris nul-terminated. she'll figure out the end herself, main character energy π«Ά
πΈ DESCRIPTION πΈ
she converts a string into canonical form. what does that even mean. okay so imagine one character with an accent β it could be written as a base character plus a combining accent, OR as one single precomposed character. same vibe, different bytes. this function standardizes all that drama. β¨
the normalization mode is NFKC β that's ALL COMPOSE btw. it standardizes differences that don't affect the text content, like the accent representation situation we just talked about. it also standardizes the "compatibility" characters in Unicode, like SUPERSCRIPT THREE becoming the standard forms (in this case DIGIT THREE). and yes, formatting information may be lost π but for most text operations those characters should be considered the same anyway. and it returns a result with composed forms rather than a maximally decomposed form. so she composes. she's a composer. π
Return value: she returns a newly allocated string that is the NFKC normalized form ofstr, orNULLon error.NULLis the villain arc, avoid it. π
π DEPRECATED π
okay. deep breath. she's deprecated. π
there's no replacement functionality in GNU SASL β instead, use GNU Libidn. and listen, this is the important bit, in SASL you most likely want to use SASLprep and not bare NFKC. see gsasl_saslprep(). so like, do that instead. periodt. π
π REPORTING BUGS π
found a bug? bestie, tell the devs, they want to know, no gatekeeping:
- Report bugs to <bug-gsasl@gnu.org>.
- General guidelines for reporting bugs: http://www.gnu.org/gethelp/
- GNU SASL home page: http://www.gnu.org/software/gsasl/
π COPYRIGHT π
Copyright Β© 2002-2021 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. (iconic of them honestly, we love a permissive license π«Ά)
π SEE ALSO π
the full documentation for gsasl is maintained as a Texinfo manual. if the info and gsasl programs are properly installed at your site, the command
info gsasl
should give you access to the complete manual. as an alternative you may obtain the manual from:
http://www.gnu.org/software/gsasl/manual/
iykyk πβ¨
and that's the whole page bestie, we ate and left no crumbs π this was gsasl version 1.10.0, page gsasl_stringprep_nfkc(3), and yeah she's deprecated so go use gsasl_saslprep() instead, mwah ππ§
π¦ where this page comes from
- ubuntu jammy: libgsasl-dev 1.10.0-5 Β· 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